AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

User determined hotkey.

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Wed Apr 20, 2005 2:04 am    Post subject: User determined hotkey. Reply with quote

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

PostPosted: Wed Apr 20, 2005 3:33 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Wed Apr 20, 2005 3:52 am    Post subject: Reply with quote

E.g. this
http://www.autohotkey.com/forum/viewtopic.php?t=1989
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Guest






PostPosted: Wed Apr 20, 2005 4:00 am    Post subject: Reply with quote

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

PostPosted: Wed Apr 20, 2005 11:43 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Wed Apr 20, 2005 7:43 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group