Send existing key modifiers to autohotkey?

I try to send the pressed modifiers using the "Send" command, only as I came up with, lists them all:

; (Note: I've remapped using registry the Capslock as F13) F13 & h:: if GetKeyState("Control") && GetKeyState("Shift") { Send +^{Left} return } if GetKeyState("Control") { Send ^{Left} return } if GetKeyState("Shift") { Send +{Left} return } Send {Left} return 

On Windows, if you press ctrl + left, it will move the word left; if I press Ctrl + shift + left, it selects the word left. Similarly, I would like to send existing modifiers, as in the above example, but is there an easier way? Pseudo-code: F13 & h::Send {CurrentlyPressedModifiers}{Left}

+4
source share
2 answers

You can do this using the Send mode, {Blind}. Example:

 *a::Send, {Blind}{Left} 

* accepts all modifiers for a and {Blind} passes modifiers to the Send command.

Alternatively, you can avoid sending and using:

 a::Left 

Here, all modifiers are automatically passed to the Left command.

Note. As far as I see after testing, not a single solution will work with "your" combination keys, only with standard hot keys.

Thus, your initial decision may be the only one if you do not change the combination keys to standard hot keys.

+6
source

I know this is an old post, but id is to share my script that relates to this problem.

 SetCapsLockState, alwaysoff CapsLock & i::send {Blind}{Up} CapsLock & k::send {Blind}{Down} CapsLock & j::send {Blind}{Left} CapsLock & l::send {Blind}{Right} CapsLock & n::send {Blind}{Home} CapsLock & m::send {Blind}{End} CapsLock & u::send {Blind}{BS} CapsLock & o::send {Blind}{Del} 

Capslock is disabled and holds it by matching the arrow keys in i, j, k, l. {Blind} allows modifiers.

Home, end, backspace and deletion are also reassigned for faster text entry.

0
source

Source: https://habr.com/ru/post/1468912/


All Articles