Using a text key with numpad

Get help with using AutoHotkey and its commands and hotkeys
Posts: 1
Joined: 19 Jul 2018, 10:59

Using a text key with numpad

19 Jul 2018, 11:34


Been trying to get my numpad keys to produce numbers, but without Num Lock turned on. Used a text key (R) as a hotkey, while trying to retain its original function. (Using usual hotkeys like alt, ctrl is not an option.)


Code: Select all

~r & NumpadIns::   Send, 0
but it gives me r0 :-(

Is there any way to achieve the following behaviour:

• Once the text key (R) is pressed and then released, it still gives R.
• But when it's pressed, held and then followed by a numpad key, it gives the number.
• While the text key is still held, the system, if needed, would receive other key inputs like space, dot, comma, etc.

I realize it's a noob question (that's what I am to AHK). Sorry if such question has been asked here already. Would greatly appreciate any help. Thanks in advance!
Posts: 1623
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Using a text key with numpad

20 Jul 2018, 01:28


Code: Select all

*r Up::
If A_PriorKey = r
	Send, {Blind}r
r & NumpadIns::Send, 0
r & NumpadEnd::Send, 1
r & NumpadDown::Send, 2
r & NumpadPgDn::Send, 3
r & NumpadLeft::Send, 4
r & NumpadClear::Send, 5
r & NumpadRight::Send, 6
r & NumpadHome::Send, 7
r & NumpadUp::Send, 8
r & NumpadDel::Send, 9
R or r is written after the r key is released,
since the script must wait to see whether another key is pressed in addition.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot] and 79 guests