Scripting Numpad Keys

Get help with using AutoHotkey and its commands and hotkeys
bforn87
Posts: 1
Joined: 01 Aug 2020, 15:36

Scripting Numpad Keys

01 Aug 2020, 16:02

I'm struggling to create a script so the functions below happen. I would appreciate anyone's help at this point. Thanks in advance.

Ctrl (or Alt) + Numpad1 = Page Up
Ctrl (or Alt) + Numpad2 = Down Arrow
Ctrl (or Alt) + Numpad3 = Page Down
Ctrl (or Alt) + Numpad4 = Left Arrow
Ctrl (or Alt) + Numpad6 = Right Arrow
Ctrl (or Alt) + Numpad7 = Home
Ctrl (or Alt) + Numpad8 = Up Arrow
Ctrl (or Alt) + Numpad9 = End

Brian
RubbeH
Posts: 6
Joined: 13 Jul 2020, 08:40

Re: Scripting Numpad Keys

01 Aug 2020, 16:15

bforn87 wrote:
01 Aug 2020, 16:02
I'm struggling to create a script so the functions below happen. I would appreciate anyone's help at this point. Thanks in advance.

Ctrl (or Alt) + Numpad1 = Page Up
Ctrl (or Alt) + Numpad2 = Down Arrow
Ctrl (or Alt) + Numpad3 = Page Down
Ctrl (or Alt) + Numpad4 = Left Arrow
Ctrl (or Alt) + Numpad6 = Right Arrow
Ctrl (or Alt) + Numpad7 = Home
Ctrl (or Alt) + Numpad8 = Up Arrow
Ctrl (or Alt) + Numpad9 = End

Brian
Hello!
Try this:

Edit:
heh, I'm new. This is perfect:

Code: Select all

^Numpad1::Send, {PgUp}
^Numpad2::Send, {Down}
^Numpad3::Send, {PgDn}
^Numpad4::Send, {Left}
^Numpad6::Send, {Right}
^Numpad7::Send, {Home}
^Numpad8::Send, {Up}
^Numpad9::Send, {End}
Old :thumbdown: :

Code: Select all

Control & Numpad1::
Send, {PgUp}
return
Control & Numpad2::
Send, {Down}
return
Control & Numpad3::
Send, {PgDn}
return
Control & Numpad4::
Send {Left}
return
Control & Numpad6::
Send, {Right}
return
Control & Numpad7::
Send, {Home}
return
Control & Numpad8::
Send, {Up}
return
Control & Numpad9::
Send, {End}
return
Last edited by RubbeH on 01 Aug 2020, 16:31, edited 1 time in total.
gregster
Posts: 4631
Joined: 30 Sep 2013, 06:48

Re: Scripting Numpad Keys

01 Aug 2020, 16:27

For modifiers like Ctrl you should use the corresponding modifier symbols, in this case ^:

Code: Select all

^Numpad1::Send, {PgUp}
^Numpad2::Send, {Down}
; and so on
That should avoid some problems...

Please note that you need to add more hotkey variants, if the hotkeys should also work when Numlock is off. Please compare https://www.autohotkey.com/docs/KeyList.htm#numpad
regnillob
Posts: 6
Joined: 30 Jul 2020, 21:52

Re: Scripting Numpad Keys

01 Aug 2020, 20:23

It might be worth mentioning that at least on Windows, Shift already does this with the number pad, in case you can use that key instead of Control or Alt.

Return to “Ask For Help”

Who is online

Users browsing this forum: BIGZIPZ, boiler, doubledave22, Google [Bot], HelpmePLEASE, JaydeNpie, jvlz, Smile_ and 48 guests