microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
109.73k stars 6.47k forks source link

Add an ability to take into account the Caps Lock key status when remapping shortcuts #4699

Closed Arseni-Paharelau closed 3 years ago

Arseni-Paharelau commented 4 years ago

Please, add an ability to take into account the Caps Lock key status when remapping shortcuts and maybe other keys which can be turned on and off.

The reason behind this is the following. Some laptops, for instance Surface Book, doesn't contain a numpad and any special key which turns a part of the keyboard to the numpad.

So, I personally had to write an AutoHotKey script to remap the "Shift + u" to 7, "Shift + i" to 8 and so on, but only when Caps Lock key is turned on.

Here is the full script code:

#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.

#Singleinstance force

#If GetKeyState("CapsLock", "T")
<+m::Send,1
<+,::Send,2
<+.::Send,3
<+j::Send,4
<+k::Send,5
<+l::Send,6
<+u::Send,7
<+i::Send,8
<+o::Send,9
<+n::Send,0
<+/::Send,.
<+8::Send,/
<+9::Send,*
<+p::Send,-
<+`;::Send,{+}

It would be nice if the Keyboard Manager would allows us to remap a shortcut to a single key when some key is turned on. For instance: remap "Shift + u" to 7 only when "Caps Lock" is turned on.

Thank you!

enricogior commented 3 years ago

Closing as duplicate of https://github.com/microsoft/PowerToys/issues/3326