jackhammer_bob Posted January 16, 2008 Share Posted January 16, 2008 I want to create a function so that when I press shift, it holds shift down. And when I press shift again, it stops holding shift down. Any help would be appreciated. Global $Shift HotKeySet("{LSHIFT}", "Toggleshift") Func Toggleshift() $Shift = NOT $Shift If $Shift = 0 Then Send ("{SHIFTDOWN}") Else Send ("{SHIFTUP}") EndIf EndFunc What am I doing wrong? Link to comment Share on other sites More sharing options...
Nahuel Posted January 16, 2008 Share Posted January 16, 2008 Help File:The following hotkeys cannot be set:Alt, Ctrl, Shift, Win These are the modifier keys themselves! Link to comment Share on other sites More sharing options...
jackhammer_bob Posted January 16, 2008 Author Share Posted January 16, 2008 (edited) Good catch, now the problem becomes Shift goes down and don't come up. I think the way I approached this was entirely wrong. Edited January 16, 2008 by jackhammer_bob Link to comment Share on other sites More sharing options...
Nahuel Posted January 16, 2008 Share Posted January 16, 2008 Good catch, now the problem becomes Shift goes down and don't come up. I think the way I approached this was entirely wrong.Maybe because now the un-set hotkey is being affected by the shift key being pressed?Example. Let's say you use F10 as a hotkey. So, you press F10 and the shift key is held. Now when you want to unset this, you'll actually be pressing shift+F10. Link to comment Share on other sites More sharing options...
ReaImDown Posted January 16, 2008 Share Posted January 16, 2008 Good catch, now the problem becomes Shift goes down and don't come up. I think the way I approached this was entirely wrong.hmmm what was the point for this again? you can try and use _Ispressed() [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
ReaImDown Posted January 16, 2008 Share Posted January 16, 2008 (edited) Maybe because now the un-set hotkey is being affected by the shift key being pressed?Example. Let's say you use F10 as a hotkey. So, you press F10 and the shift key is held. Now when you want to unset this, you'll actually be pressing shift+F10.CODE#include<Misc.au3>Global $Shift;HotKeySet("{PAUSE}", "Toggleshift")$dll = DllOpen("user32.dll")While 1 if _IsPressed(0x09, $dll) then ;Tab Toggleshift() EndIf WEndFunc Toggleshift()$Shift = NOT $ShiftIf $Shift = 0 ThenSend ("{SHIFTDOWN}")ElseSend ("{SHIFTUP}")EndIfEndFuncGet the Hex keycodes herehttp://www.kbdedit.com/manual/low_level_vk_list.html Edited January 17, 2008 by ReaImDown [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
GaryFrost Posted January 17, 2008 Share Posted January 17, 2008 (edited) Do everyone a favor and remove the key logger info from your signature.Never mind, removed it myself Edited January 17, 2008 by GaryFrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now