| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Wed Apr 20, 2005 2:04 am Post subject: User determined hotkey. |
|
|
How do I let the user press a key and then it stores the key into a variable and then the key is the hotkey for a specific action.
If I say
mykey = xbutton1
mykey:: send, abc
that dont work. It says mykey is not a valid keyname. Also is there a way of determining what key is pressed without having them type it into an input box. Like a box tells them to press any key for the hotkey and when the user presses it then it stores the key. |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3841 Location: Bremen, Germany
|
Posted: Wed Apr 20, 2005 3:33 am Post subject: |
|
|
You could use the command "Hotkey". There has been a topic on this with a complete script going with it. Search for it. _________________ Ciao
toralf  |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3841 Location: Bremen, Germany
|
|
| Back to top |
|
 |
Guest
|
Posted: Wed Apr 20, 2005 4:00 am Post subject: |
|
|
| i been searchin forever and decided to post. Well i got it before i read this but now I have a diff problem. How do I detect if a hotkey will have an error before it happens. Like adfa::send, key wont work becuz adfa is not a key. I want to detect this and give a error message for this. |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3841 Location: Bremen, Germany
|
Posted: Wed Apr 20, 2005 11:43 am Post subject: |
|
|
if you would use a AHK Gui you could use the option limit on the edit box. Otherwice you have to parse the input and check it for correctness, I suppose. _________________ Ciao
toralf  |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Wed Apr 20, 2005 7:43 pm Post subject: |
|
|
There's also a GUI hotkey control that validates that whatever the user has entered is a valid hotkey.
Since the hotkey command could benefit from a UseErrorLevel option for creating dynamic/user-entered hotkeys without causing a runtime error, I've added this to the to-do list. Thanks. |
|
| Back to top |
|
 |
|