Numpad 4 + Numpad 5 = Numpad 8 ?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
henrychang
Posts: 6
Joined: 25 Sep 2017, 04:09

Numpad 4 + Numpad 5 = Numpad 8 ?

25 Sep 2017, 04:44

I wrote a script for entering numbers faster when the input method is in Chinese (which is my mother language).

Code: Select all

#1::Send {Numpad1}
#2::Send {Numpad2}
#3::Send {Numpad3}
#4::Send {Numpad4}
#5::Send {Numpad5}
#6::Send {Numpad6}
#7::Send {Numpad7}
#8::Send {Numpad8}
#9::Send {Numpad9}
#0::Send {Numpad0}
I think this is an simple script. However, pressing winkey+4+5 or pressing winkey+4 then release 4 and quickly press 5 will often give me a "485","458" or "548".
This bug also applies to winkey+6+7, giving me "687" or "768" or so.
Other combinations don't have any problems (like winkey+1+2).
What might be the cause of this bug?
Thank you in advance!
User avatar
dmg
Posts: 287
Joined: 02 Oct 2013, 01:43
Location: "Twelve days north of Hopeless and a few degrees south of Freezing to Death"
Contact:

Re: Numpad 4 + Numpad 5 = Numpad 8 ?

26 Sep 2017, 08:40

I can't seem to reproduce the issue... If I can't see what it is doing then it is very hard to figure out WHY it might be doing it. :(

Can you explain more about how the script is supposed to be used?
"My dear Mr Gyrth, I am never more serious than when I am joking."
~Albert Campion
------------------------------------------------------------------------
Website | Demo scripts | Blog | External contact
iPhilip
Posts: 822
Joined: 02 Oct 2013, 12:21

Re: Numpad 4 + Numpad 5 = Numpad 8 ?

26 Sep 2017, 14:16

You might want to put this line:

Code: Select all

SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
at the top of your script to improve reliability.
Windows 10 Pro (64 bit) - AutoHotkey v2.0+ (Unicode 64-bit)
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: Numpad 4 + Numpad 5 = Numpad 8 ?

26 Sep 2017, 14:34

You mention Chinese is your mother language -- do you use Chinese language on your computer?

My suspicion is that your keyboard and/or the operating system language (and keyboard driver) are very peculiar. Have you tried NOT running your script and pressed Win+4+5to see if it produces a Numpad8 or 8? How about 4+5 without the Windows key?

There may be a workaround regardless if we can diagnose the problem. You can make a Numpad8 or 8 hotkey that does nothing by just using the Return command. You might even just turn on and off his hotkey with the Hotkey command.

Code: Select all

#4::
Hotkey, Numpad8, On
SetTimer, Numpad8_TurnOff, -200
Send {Numpad4}
return

Numpad8_TurnOff:
Hotkey, Numpad8, Off
return

Numpad8::return ; when on, the Numpad8 key is disabled
Now, it may not be the Numpad8 key that is the produced key stroke if all you see is "8" produced on screen. So you may need to turn off the 8 key as well by using 8::return instead. And also, initially, you may want to use in the auto-execute section Hotkey, Numpad8, Off.
henrychang
Posts: 6
Joined: 25 Sep 2017, 04:09

Re: Numpad 4 + Numpad 5 = Numpad 8 ?

01 May 2018, 00:26

Thanks everyone for the help. It turn out that even turning off the script will have this problem. I shifted the number hotkeys from windows key to alt key.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: RandomBoy and 252 guests