Reputation: 5764
I'm trying to send pressed modifiers with the Send command, only way I come up with is listing 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
In Windows if you press ctrl+left it jumps a word left, if I press ctrl+shift+left it selects a word leftwise. Similarily I'd like to send the existing modifiers as in above example, but is there a simpler way? Pseudocode: F13 & h::Send {CurrentlyPressedModifiers}{Left}
Upvotes: 5
Views: 4380
Reputation: 1721
I know this is an old post but id like to share my script that applys 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 holding it down maps the arrows keys in to i,j,k,l. The {Blind} allows for modifiers.
Home, End, Backspace and Delete are also remapped for much quicker typing.
Upvotes: 1
Reputation: 7953
You can do this with the Send, {Blind} mode. Example:
*a::Send, {Blind}{Left}
The *
accepts all modifiers for a and {Blind} passes the modifiers on to the Send
command.
Alternatively, you can avoid Send and use:
a::Left
Here all modifiers are automatically passed on to the Left
command.
So your initial solution might be the only one, unless you change the combination keys back to standard hotkeys.
Upvotes: 7