Help capturing Numpad keys with Input Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ZythiQ
Posts: 12
Joined: 28 Jan 2021, 21:11

Help capturing Numpad keys with Input

28 Jan 2021, 21:35

Code: Select all

~Alt::
Input, UserInput, I L4 M T4 V
KeyWait, Alt
if UserInput = 0256
    Do something
if UserInput = 0257
    Do something else
return
I wanted to make a quick script that would utilize the alt-code system and all the codes after 0256 to do some special stuff like open programs or certain tabs. However, although this script I made works fine, I can't capture the Numpad keys with Input, which is basically the point (only the default number row above the letters work). Is there a way I can capture the Numpad keys as normal numbers (ie. Numpad0 = 0)? Anyhow, thanks!
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Help capturing Numpad keys with Input  Topic is solved

28 Jan 2021, 22:04

I had no trouble.

Code: Select all

Input, key, L1
MsgBox, 64, Result, You pressed: %key%
ZythiQ
Posts: 12
Joined: 28 Jan 2021, 21:11

Re: Help capturing Numpad keys with Input

28 Jan 2021, 22:33

mikeyww wrote:
28 Jan 2021, 22:04
I had no trouble.

Code: Select all

Input, key, L1
MsgBox, 64, Result, You pressed: %key%
Apologies, I should've specified my problem completely. When you hold a modifier key like Alt, the Numpad values aren't recorded by input. I was hoping there would be a way to get around this, if not I can switch to the FN key. Anyhow, thank you for letting me realize this!
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Help capturing Numpad keys with Input

29 Jan 2021, 07:04

I see! I wasn't looking at the bigger picture.

The following worked for me.

Code: Select all

~Alt Up::Return
Alt::
Input, key, L1
MsgBox, 64, Result, You pressed: %key%
Return
ZythiQ
Posts: 12
Joined: 28 Jan 2021, 21:11

Re: Help capturing Numpad keys with Input

17 Apr 2021, 20:42

Thanks a lot! I got locked out of my account for some time now, so I'm just seeing this. I would've never thought to affix “return” to a hotkey, but I'll be sure to use that later down the line for sure. :dance:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 237 guests