HelpChange Hotkey via Button

Posts 1–10 of 10 · Page 1 of 1
Change Hotkey via Button
I would like to change a hotkey (from getasynckeystate) via button. Just like puush:

How could I do this?


anyone? /msg2short
Quote Originally Posted by ineedwarrockhack View Post
anyone? /msg2short
push the button to change the hotkey?
Quote Originally Posted by Biesi View Post


push the button to change the hotkey?
Thats what I'm trying to do, yes.
Quote Originally Posted by Womanizer` View Post


Thats what I'm trying to do, yes.
Why not apply the key_down event to the button?

OR:
Make a pop-up form with a text box, which will capture they keys down.
Quote Originally Posted by Jorndel View Post


Why not apply the key_down event to the button?

OR:
Make a pop-up form with a text box, which will capture they keys down.
I guess I could do like "detect key" and then write the key pressed.

Now I've encountered another problem. How would I be able to change the hotkey for getasynckeystate while the program running?
This is the code that I have for getasynckeystate:
Code:
        Dim firstkey As Boolean
        Dim secondkey As Boolean
        Dim thirdkey As Boolean

        firstlkey = GetAsyncKeyState(Keys.ControlKey)
        secondkey = GetAsyncKeyState(Keys.ShiftKey)
        thirdkey = GetAsyncKeyState(Keys.F12)

        If firstkey And secondkey And thirdkey = True Then
            captureAreaStart.Show()
        End If
I was trying to do something like getasynckeystate("Keys." & blablabla.text") but that wouldn't work. Got any ideas?
Quote Originally Posted by Womanizer` View Post


I guess I could do like "detect key" and then write the key pressed.

Now I've encountered another problem. How would I be able to change the hotkey for getasynckeystate while the program running?
This is the code that I have for getasynckeystate:
Code:
        Dim firstkey As Boolean
        Dim secondkey As Boolean
        Dim thirdkey As Boolean

        firstlkey = GetAsyncKeyState(Keys.ControlKey)
        secondkey = GetAsyncKeyState(Keys.ShiftKey)
        thirdkey = GetAsyncKeyState(Keys.F12)

        If firstkey And secondkey And thirdkey = True Then
            captureAreaStart.Show()
        End If
I was trying to do something like getasynckeystate("Keys." & blablabla.text") but that wouldn't work. Got any ideas?
So, do like me?

Dim a varriable to hold the key value for you, and use that
Code:
getasynckeystate(FirstKey)
Quote Originally Posted by Jorndel View Post


So, do like me?

Dim a varriable to hold the key value for you, and use that
Code:
getasynckeystate(FirstKey)
I don't understand what you are trying to tell me o.O
Quote Originally Posted by Womanizer` View Post


I don't understand what you are trying to tell me o.O
Erm... I'm a little shocked now
We declare a variable inside the class, instead of the method/function/sub.
-Meaning it can be accessed by everything within the form1 class.

Meaning: If you assign a value to it, you just use that variable. To be the 'getkeyasnycstate' Key


Well, made a short code then to show you:
Sooo.. You're trying to change the hotkey to a specific key when you click the button or..?
Or Formkeydown event
If e.keycode = Keys.sum
blah
End If
Posts 1–10 of 10 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?