NewBe Posted December 19, 2007 Share Posted December 19, 2007 I know I could may be do this but I don't want it to get to long and confusing... I want a GUI with a input box and when the user presses a key or keys it will input it in the inputbox then convert it to a actual hotkey so really all it does is wait for a user to push any key or keys then converts it to hotkey but the main problem is how do I know what keys are being pushed (_ispressed?) I think this function would come into play. so... Hotkey(_Ispressed($Key)) Link to comment Share on other sites More sharing options...
someone Posted December 20, 2007 Share Posted December 20, 2007 This may be only half the answer you want... try this code out; $var = InputBox("Key...", "Enter key to be used with a hotkey") HotKeySet("{" & $var & "}", "_MyFunc") HotKeySet("{ESC}", "Terminate") While 1 Sleep(100) WEnd Func _MyFunc() MsgBox(0, "", "Yay") EndFunc Func Terminate() Exit EndFunc I say that may only be half the answer because you have to physically type in f1 (for example) and not just press F1. If you want to create the ability to just press on the keyboard your hotkey(s) of choice, you'll have to use _IsPressed, a loop, and some elbow grease... I would suggest searching around and see if you can find anything useful. Sorry I wasn't of more help. While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd Link to comment Share on other sites More sharing options...
therks Posted December 20, 2007 Share Posted December 20, 2007 Something like this was already done actually (even did it myself). Doesn't work as well as you'd think though because HotKeys and Virtual Keys are different. Have a search around the forums and I'm sure you'll turn up something eventually. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
NewBe Posted December 20, 2007 Author Share Posted December 20, 2007 Thanks guys Virtual keys? I want the user to set a hotkey to call a function in a script but I want it to be user friendly by allowing them to choose their owns keys Link to comment Share on other sites More sharing options...
Nahuel Posted December 20, 2007 Share Posted December 20, 2007 Yeah, check out this thread: http://www.autoitscript.com/forum/index.ph...mp;hl=hotkeyset Link to comment Share on other sites More sharing options...
NewBe Posted December 20, 2007 Author Share Posted December 20, 2007 Yeah, check out this thread: http://www.autoitscript.com/forum/index.ph...mp;hl=hotkeysetThanks to all of you your awesome 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