Sign in to follow this  
Followers 0
NewBe

Hotkey Set Complicated Problem

6 posts in this topic

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))

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0