Aro2220 Posted April 12, 2010 Share Posted April 12, 2010 (edited) HotKeySet("E", "EKey") Func EKey() Send("{BACKSPACE}") Send("=") Send("7") Send("-") EndFunc This is helpful except when I want to type. I don't want to have to start and restart the script since it requires tabbing into autoit script editor and hitting f5 again. Is there a way to disable/enable hotkeys? I tried putting in something like Func EKey() if $blah = 1 Then Send("{BACKSPACE}") Send("=") Send("7") Send("-") Elseif $blah = 2 Then Send ("e") EndIf EndFunc Of course that just causes an infinite loop when I hit the e key. I'm thinking of doing something like this: HotKeySet("E", "EKey") $count = 0 $blah = 1 Func EKey() if $count = 0 Then if $blah = 1 Then Send("{BACKSPACE}") Send("=") Send("7") Send("-") Elseif $blah = 2 Then Send ("E") $count = 1 EndIf else $count = 0 EndIf EndFunc Is there a better way to do this? Would this even work? Edited April 12, 2010 by Aro2220 Link to comment Share on other sites More sharing options...
funkey Posted April 12, 2010 Share Posted April 12, 2010 Did you read the documentation of HotKeySet? function[optional] The name of the function to call when the key is pressed. Not specifying this parameter will unset a previous hotkey. Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
sahsanu Posted April 12, 2010 Share Posted April 12, 2010 Maybe you could make a Hotkey to disable the others, something like this: Global $hotkeys=0 ;By default hotkeys are disabled HotKeySet("^!m","_EnableDisable") ;We use ctrl+alt+m to activate/deactivate HotKeys While 1 Sleep(250) WEnd Func _EnableDisable() If $hotkeys=0 Then ;Hotkeys are disabled so we enable them HotKeySet("E","_Ekey") $hotkeys=1 ;We know now Hotkeys are enabled Else HotKeySet("E") ;Disable HotKey "E" $hotkeys=0 ;We know now Hotkeys are disabled EndIf EndFunc Func _Ekey() MsgBox(0,"","_Ekey activated") EndFunc Link to comment Share on other sites More sharing options...
Aro2220 Posted April 12, 2010 Author Share Posted April 12, 2010 If I HotKeySet("E") it will disable the hotkey. Thank you. AnonymousX 1 Link to comment Share on other sites More sharing options...
Aro2220 Posted April 12, 2010 Author Share Posted April 12, 2010 Did you read the documentation of HotKeySet?sorry 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