Jump to content

Hotkey Set Complicated Problem


NewBe
 Share

Recommended Posts

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...