vscode:是否可以将(不重新映射)`caps lock`作为修饰键之一?

时间:2017-01-16 01:45:57

标签: visual-studio-code vscode-settings

我不是要求将Caps Lock重新映射到其他修饰键,但我想将Caps Lock配置为我自己使用的修饰键之一。有任何想法吗? :d

2 个答案:

答案 0 :(得分:2)

在Windows上,您可以使用AutoHotKey(通常简称为ahk)和WinActive函数,使ahk脚本仅在您使用vscode时工作,通常将CapsLock+*键映射到未使用的组合,如ctrl+shift+alt+*,并将ctrl+shift+alt+*键写入vscode的关键配置。

大概如下:

; comment: the class used here is made up
; right click a running script in the system tray and go to "window spy" to get the right class name
; there are also usual `if`s but this one applies the condition to all the code following it
#If WinActive("ahk_class VSCode")

CapsLock & a::
SendInput, ^+!a
return

当然,如果你想在编辑器中获得大写字母的功能,你可以轻松地使用像CapsLock & Shift之类的组合来完成它,就像上面一样。

答案 1 :(得分:0)

对于x11操作系统(如大多数Linux发行版),请使用xmodmap。像

keycode 66 = Alt_L Meta_L
clear mod1
add mod1 = Alt_L Meta_L
您的.Xmodmap文件中的

应该足够。

然后运行:

xmodmap .Xmodmap