Need Help Binding Ctrl + Shift to Numpad2

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Thunder
Posts: 13
Joined: 02 Aug 2023, 09:18

Need Help Binding Ctrl + Shift to Numpad2

07 Aug 2023, 05:14

Hey everyone,

I hope you're doing well. I'm currently trying to bind the Ctrl + Shift combination to my Numpad2 key using AutoHotkey, but I'm facing some issues. I've written the following code:

Numpad2::Send ^+

However, it doesn't seem to work as expected. When I press the Numpad2 key, nothing happens. I'm wondering if I'm missing something in the code or if there's a different approach to achieving this key binding.

Has anyone successfully bound Ctrl + Shift to a specific key using AutoHotkey? If so, could you please guide me on how to do it correctly? I'd appreciate any insights, suggestions, or corrections to my current code.

Thank you in advance for your help!
User avatar
boiler
Posts: 17392
Joined: 21 Dec 2014, 02:44

Re: Need Help Binding Ctrl + Shift to Numpad2

07 Aug 2023, 05:23

Are you really using v2? You posted in the v2 section. As you were told the other day in another thread (to which you didn’t reply), you are writing v1 code and posting in the v2 section. You first need to determine which version you are using.

More specific to your question is that you are trying to send two modifier symbols. One of them would need to be a valid key name using correct syntax.

Please state which AHK version you are using so that the proper direction can be given.
Thunder
Posts: 13
Joined: 02 Aug 2023, 09:18

Re: Need Help Binding Ctrl + Shift to Numpad2

07 Aug 2023, 06:12

My fault. Im using v1. If possible, maybe Admin could move this thread to v1.

What would be a valid key using correct syntax?
Last edited by gregster on 07 Aug 2023, 06:13, edited 1 time in total.
Reason: Moved topic to AHK v1 help.
User avatar
boiler
Posts: 17392
Joined: 21 Dec 2014, 02:44

Re: Need Help Binding Ctrl + Shift to Numpad2

07 Aug 2023, 06:30

Try this:

Code: Select all

Numpad2::Send ^{Shift}
Thunder
Posts: 13
Joined: 02 Aug 2023, 09:18

Re: Need Help Binding Ctrl + Shift to Numpad2

07 Aug 2023, 06:48

boiler wrote:
07 Aug 2023, 06:30
Try this:

Code: Select all

Numpad2::Send ^{Shift}
I really appreciate your help! but unfortunately it doesn't seem to work for me. What could I be doing wrong?
User avatar
boiler
Posts: 17392
Joined: 21 Dec 2014, 02:44

Re: Need Help Binding Ctrl + Shift to Numpad2

07 Aug 2023, 06:54

It may be that you didn’t describe your need adequately. This would press and immediately release Ctrl+Shift. Is that what you are trying to accomplish? Are you trying to have it hold those keys down? If so, when would they be released?
Thunder
Posts: 13
Joined: 02 Aug 2023, 09:18

Re: Need Help Binding Ctrl + Shift to Numpad2

07 Aug 2023, 07:08

boiler wrote:
07 Aug 2023, 06:54
It may be that you didn’t describe your need adequately. This would press and immediately release Ctrl+Shift. Is that what you are trying to accomplish? Are you trying to have it hold those keys down? If so, when would they be released?
I would like it to emulate in the same way as if I were holding down Ctrl + Shift when I press Numpad 2. In other words, when I hold down Numpad 2, it's as if I'm holding down Ctrl + Shift, and when I release Numpad 2, I'm releasing Ctrl + Shift.
User avatar
boiler
Posts: 17392
Joined: 21 Dec 2014, 02:44

Re: Need Help Binding Ctrl + Shift to Numpad2

07 Aug 2023, 08:28

Try this:

Code: Select all

Numpad2::
Send {Ctrl down}{Shift down}
KeyWait, Numpad2
Send {Ctrl up}{Shift up}
return
Master_X
Posts: 33
Joined: 04 Aug 2023, 13:59

Re: Need Help Binding Ctrl + Shift to Numpad2

07 Aug 2023, 09:28

Code: Select all

Numpad2::^+
Does not work?!

And what you try to do?
Thunder
Posts: 13
Joined: 02 Aug 2023, 09:18

Re: Need Help Binding Ctrl + Shift to Numpad2

07 Aug 2023, 09:39

boiler wrote:
07 Aug 2023, 08:28
Try this:

Code: Select all

Numpad2::
Send {Ctrl down}{Shift down}
KeyWait, Numpad2
Send {Ctrl up}{Shift up}
return
Thank you, however, it doesn't seem to work; it gets stuck on ctrl+shift
User avatar
mikeyww
Posts: 27369
Joined: 09 Sep 2014, 18:38

Re: Need Help Binding Ctrl + Shift to Numpad2

07 Aug 2023, 09:57

Possibly:

Code: Select all

#Requires AutoHotkey v1.1.33

Numpad2::
Send {Ctrl down}{Shift down}
SoundBeep 1500
Sleep 100
KeyWait NumpadDown
Send {Shift up}{Ctrl up}
SoundBeep 1000
Return
User avatar
boiler
Posts: 17392
Joined: 21 Dec 2014, 02:44

Re: Need Help Binding Ctrl + Shift to Numpad2

07 Aug 2023, 13:47

Good point, @mikeyww. Shift down with Numpad keys can/does change things, so it would change how it registers as a hotkey.

By the way, @Thunder, you reported someone's post in this thread to the forum staff as containing spam. I didn't see anything of the sort, so I assume that was a mistake and I closed the report.
Thunder
Posts: 13
Joined: 02 Aug 2023, 09:18

Re: Need Help Binding Ctrl + Shift to Numpad2

08 Aug 2023, 06:38

mikeyww wrote:
07 Aug 2023, 09:57
Possibly:

Code: Select all

#Requires AutoHotkey v1.1.33

Numpad2::
Send {Ctrl down}{Shift down}
SoundBeep 1500
Sleep 100
KeyWait NumpadDown
Send {Shift up}{Ctrl up}
SoundBeep 1000
Return
Thank you! :)
Thunder
Posts: 13
Joined: 02 Aug 2023, 09:18

Re: Need Help Binding Ctrl + Shift to Numpad2

08 Aug 2023, 06:39

boiler wrote:
07 Aug 2023, 13:47
Good point, @mikeyww. Shift down with Numpad keys can/does change things, so it would change how it registers as a hotkey.

By the way, @Thunder, you reported someone's post in this thread to the forum staff as containing spam. I didn't see anything of the sort, so I assume that was a mistake and I closed the report.
Yes. Again, thank you! :)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, Google [Bot], mikeyww and 159 guests