flick Posted October 4, 2008 Share Posted October 4, 2008 While 1 If _IsPressed("h") Then Send("{p down}") Sleep(250) EndIf If _IsPressed("o") Then Send("{p up}") Sleep(250) WEnd Func _Quit() Exit EndFunc ;==>_Quit rather than doing the hotkey on top of what i'm manually clicking, it cancels everything i have selected. how can i fix this? Link to comment Share on other sites More sharing options...
martin Posted October 4, 2008 Share Posted October 4, 2008 While 1 If _IsPressed("h") Then Send("{p down}") Sleep(250) EndIf If _IsPressed("o") Then Send("{p up}") Sleep(250) WEndFunc _Quit() ExitEndFunc ;==>_Quitrather than doing the hotkey on top of what i'm manually clicking, it cancels everything i have selected.how can i fix this?You need to read the help for _IsPressed. In the help it lists the codes to be used for each key, you don't use the key letter as you do for Send. (I assume yoiu want to detect when the keys for h and o are pressed.) Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
flick Posted October 5, 2008 Author Share Posted October 5, 2008 You need to read the help for _IsPressed. In the help it lists the codes to be used for each key, you don't use the key letter as you do for Send. (I assume yoiu want to detect when the keys for h and o are pressed.)i actually edited my real script which has the numbers in itmy problem is, when i use the script(which does work) it unselects everything i'm already doing. so the hotkey / unhotkey does work, but it messes up with what i'm doing. Link to comment Share on other sites More sharing options...
martin Posted October 5, 2008 Share Posted October 5, 2008 i actually edited my real script which has the numbers in itmy problem is, when i use the script(which does work) it unselects everything i'm already doing. so the hotkey / unhotkey does work, but it messes up with what i'm doing.You posted code which you know is wrong and have already corrected, but you don't post the code which would help us to understand what your problem is or know what you mean by your hotkey. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
flick Posted October 5, 2008 Author Share Posted October 5, 2008 (edited) You posted code which you know is wrong and have already corrected, but you don't post the code which would help us to understand what your problem is or know what you mean by your hotkey.While 1If _IsPressed("72") ThenSend("{p down}")Sleep(250)EndIfIf _IsPressed("74") ThenSend("{p up}")Sleep(250)WEndFunc _Quit()ExitEndFunc ;==>_Quitmy problem is when i hit those hotkeys, it does hit p(which is the key i want it to hit) but it also makes what i have selected with my mouse unselect Edited October 5, 2008 by flick Link to comment Share on other sites More sharing options...
martin Posted October 5, 2008 Share Posted October 5, 2008 While 1If _IsPressed("72") ThenSend("{p down}")Sleep(250)EndIfIf _IsPressed("74") ThenSend("{p up}")Sleep(250)WEndFunc _Quit()ExitEndFunc ;==>_Quitmy problem is when i hit those hotkeys, it does hit p(which is the key i want it to hit) but it also makes what i have selected with my mouse unselectAh, I see it is a misunderstanding. Those are not hot keys.If you have selected some text then hitting a key would normally replace the selected text with the key you type unless it is in something like an edit set to read only. Can you explain more about what you are selecting and what you want to happen when p is pressed?Is the text in your own gui or in another application? Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
flick Posted October 7, 2008 Author Share Posted October 7, 2008 (edited) "P" is an in game command that needs to be held down for a combo but i only need it held down when I hit f3(which needs to send aswell) and f4 should cancel both without interfering with what I'm selecting. and the file is just a .au3 script, I edited the default one... it works now (sends f3/p same time, f4 cancels) but it cancels what I'm doing in between. Edited October 7, 2008 by flick Link to comment Share on other sites More sharing options...
flick Posted October 9, 2008 Author Share Posted October 9, 2008 bumped Link to comment Share on other sites More sharing options...
flick Posted October 12, 2008 Author Share Posted October 12, 2008 bump, can anyone help me 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