Problem using text key as a modifier, example, w & h::

Get help with using AutoHotkey and its commands and hotkeys
Posts: 41
Joined: 16 Aug 2017, 12:37

Problem using text key as a modifier, example, w & h::

30 Jan 2020, 13:03

I would like to use some text keys as modifiers, but still have them work correctly when not used as a modifier key, for example...

w & h:: msgbox w & h pressed
w::sendinput w

Didn't work when I typed Shift W, nothing is typed, so I added... +w::sendinput W

Problem example 1, quickly typing words starting with....w....(window, want, etc), often result in the first w not being typed. I assume AHK thinks I typed the w as a modifier and not just a....w

Problem example 2, quickly typing words starting with....wh.... (when,where,what,etc), often results in the msgbox appearing instead of typing....wh

I think both problems are a timing issue, how AHK determines whether a key is being held down or just being typed. I assume there is a simple solution, if not, using any standard typing key as modifier would be useless. Is there a way to set the amount of time the modifier key is held down before it is considered a modifier?

Any help will be appreciated.
Posts: 56
Joined: 26 Jan 2020, 12:53

Re: Problem using text key as a modifier, example, w & h::

02 Feb 2020, 16:56

You can use ~ before w but this is not perfect (w will be written even if w+h is pressed) but you won't loose w when you type fast.
Let me mention that using regular keys as hotkeys is just bad idea. Anything without modifier key should be treated as mapping not hotkey.
If you won't obey this rule you gonna make your life harder.

Return to “Ask For Help”

Who is online

Users browsing this forum: DanRim, electrone77 and 31 guests