Using <v as trigger captures all 'v' keystrokes, even if LWin is not pressed Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
1337ingDisorder
Posts: 3
Joined: 25 Nov 2022, 12:51

Using <v as trigger captures all 'v' keystrokes, even if LWin is not pressed

Post by 1337ingDisorder » 25 Nov 2022, 13:03

I'm trying to remap the key combination LWin+V to instead fire the combination CTRL+ALT+P

I think I've gleaned from the documentation that the following script should accomplish that:

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
<v::^!p
The good news is that it works! When the script is running, if I hold the left Windows Key and press the letter 'v', the keyboard shortcut CTRL+ALT+P is executed. Bullseye!

The bad news: When the script is running, if I press the letter 'v' while the left Windows Key is NOT pressed, nothing happens at all. No 'v' key is typed in, for example, a text editor window, where a 'v' should normally appear when typed.

What am I doing wrong? What do I need to put into the script in order to get the desired functionality while still being able to type unmodified 'v' characters and generally use the 'v' key?

User avatar
mikeyww
Posts: 26937
Joined: 09 Sep 2014, 18:38

Re: Using <v as trigger captures all 'v' keystrokes, even if LWin is not pressed  Topic is solved

Post by mikeyww » 25 Nov 2022, 13:47

Welcome to this AutoHotkey forum!

Code: Select all

#v::Send ^!p
Check your :arrow: KeyHistory

Explained: Win

1337ingDisorder
Posts: 3
Joined: 25 Nov 2022, 12:51

Re: Using <v as trigger captures all 'v' keystrokes, even if LWin is not pressed

Post by 1337ingDisorder » 25 Nov 2022, 14:27

mikeyww wrote:
25 Nov 2022, 13:47

Code: Select all

#v::Send ^!p
That works perfectly, thanks!

lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

Re: Using <v as trigger captures all 'v' keystrokes, even if LWin is not pressed

Post by lexikos » 25 Nov 2022, 23:03

That would be for both Windows keys, not just the left one.

< only specifies "the left one", not "the left Win key". It needs to be followed by one of # ^ ! + to have any effect. <# is LWin and <+ is LShift.

1337ingDisorder
Posts: 3
Joined: 25 Nov 2022, 12:51

Re: Using <v as trigger captures all 'v' keystrokes, even if LWin is not pressed

Post by 1337ingDisorder » 26 Nov 2022, 12:17

lexikos wrote:
25 Nov 2022, 23:03
< only specifies "the left one", not "the left Win key". It needs to be followed by one of # ^ ! + to have any effect. <# is LWin and <+ is LShift.
Ahhhhh thanks for that clarification!

When I saw <# in the docs I assumed the # was a placeholder for whatever the LWin key was modifying. Like <1 would be LWin+1, <2 would be LWin+2, etc.

I guess Sigmund Jung really was right when he said, "Sometimes a pound sign is just a pound sign."

Tx again :)

User avatar
mikeyww
Posts: 26937
Joined: 09 Sep 2014, 18:38

Re: Using <v as trigger captures all 'v' keystrokes, even if LWin is not pressed

Post by mikeyww » 26 Nov 2022, 12:22

Wrong again! A pound sign is a Win key! :D

Post Reply

Return to “Ask for Help (v1)”