Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Improve the "Hotkey" GUI control


  • Please log in to reply
No replies to this topic
evilc
  • Members
  • 340 posts
  • Last active: Oct 27 2015 11:07 PM
  • Joined: 17 Nov 2005

The current hotkey control, whilst useful, is lacking.

 

Although it is possible to use hacks to improve it's functionality, it is still not possible to hack in support to detect mouse or joystick buttons.

 

From what I can tell, the control cannot be hacked to support mouse or stick because it only allows certain strings to be written to it.

For example, using the hack linked above, I can get it to detect mouse buttons, but if I try to write any string to it but keyboard keynames, it stays blank. The technique works for keys it would not normally support, but not for mouse items.

 

Joysticks are another matter. Obviously the workaround hack above works by adding an #if directive to trap the "special" keys, of which there are a pre-determined amount. However to hack in support for stick detection, one would probably need a GetKeyState loop running while the control had focus.

 

So if we could get any tweaks to the code to help solve these issues, I would be eternally grateful. I reckon adding mouse support like this wouldn't be too hard (Option to allow any string to be written to box?) but the stick one could be a little harder (Maybe some option to have it call a label every 50ms while control is active?)

 

Yes, I know these limitations are circumvent-able. For example I provide support for mouse bindings in my apps by having a dropdown next to the hotkey box to select mouse buttons, but the point is that it is messy and clutters the UI. One box that allows you to bind any input that AHK is capable of detecting would be much more desirable.

 

A list of example bindings I would like to be able to detect with the hotkey control:

Ctrl + LButton

Any joystick button

Ctrl + joystick button

Left control on it's own shows LCtrl

Right control on it's own shows RCtrl

"Special" keys (Win, Backspace, Delete, Enter, Pause, PrtScr, Space, Tab, Esc)

L or R Ctrl with key "a" shows CTRL+A