How to detect the key or button pressed

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
empardopo
Posts: 336
Joined: 06 Oct 2013, 12:50
Location: Spain
Contact:

How to detect the key or button pressed

Post by empardopo » 10 Oct 2013, 06:31

I would like to make a gui with varios "textbox" ...
My idea is to assign the key or button pressed to the textbox selected.

Has anyone done something similar ?

Thanks in advance.
Everything is possible!

jpginc
Posts: 124
Joined: 29 Sep 2013, 22:35

Re: How to detect the key or button pressed

Post by jpginc » 10 Oct 2013, 07:27

Not sure exactly what your asking but this should get you started http://auto-hotkey.com/docs/Hotkeys.htm
and http://www.auto-hotkey.com/docs/commands/GuiControl.htm specifically gui, control, focus

User avatar
empardopo
Posts: 336
Joined: 06 Oct 2013, 12:50
Location: Spain
Contact:

Re: How to detect the key or button pressed

Post by empardopo » 10 Oct 2013, 08:00

In the games, It's usually to be able to remap keys. If you want to change the upper key, you must press the new key to assign, isn't?
I want to do someting similar.

I have a textbox and I want that my script detect and assign to that textbox, the key or button pressed.

Thanks in advance.
Everything is possible!


Zelio
Posts: 278
Joined: 30 Sep 2013, 00:45
Location: France

Re: How to detect the key or button pressed

Post by Zelio » 10 Oct 2013, 13:46

As tmplinshi said, a simple example : (when the editbox have focus just press a key, that will display what you pressed, as in a game remaping control)

Code: Select all

Gui, Add, Hotkey, vChosenHotkey
Gui, Show

User avatar
empardopo
Posts: 336
Joined: 06 Oct 2013, 12:50
Location: Spain
Contact:

Re: How to detect the key or button pressed

Post by empardopo » 12 Oct 2013, 11:20

I'll take a look but I think that I only work with keys and not with joystick buttons.
Thanks very much.
Everything is possible!

Post Reply

Return to “Ask for Help (v1)”