2016-11-05 75 views
2

我正在将我的mac工作流迁移到Windows。我无法忍受的一件事是超级钥匙,它是Ctrl + Option + Shift + Cmd的组合。我使用Karabiner应用程序将Capslock重新映射到此Hyper密钥。我听说Autohotkey是一个Karabiner替代Windows的。你们能帮我在Windows中模仿这个功能吗?如何在Windows 10中使用autohotkey模拟超级密钥

我的理想结果是:

  • 停用Capslock完全是因为我很少用这个
  • 切换Capslock将执行ESC关键
  • 按住Capslock将执行Ctrl + Alt + Shift + Windows。例如Capslock + C将是Ctrl+Alt+Shift+Windows+C

非常感谢提前!

以下是我尝试用AHK脚本,但它并不适用于任何人想帮助我在所有工作:(

;----------------------------------------- 
; hyper key for windows 
;========================================= 

; -------------------------------------------------------------- 
; notes 
; -------------------------------------------------------------- 
; ! = alt 
;^= ctrl 
; + = shift 
; # = lwin|rwin 
; 
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 
#UseHook 
#InstallKeybdHook 
#SingleInstance force 

SendMode Input 

;; deactivate capslock completely 
SetCapslockState, AlwaysOff 

;; remap capslock to hyper 
Capslock:: 
SendInput {Blind}{Ctrl Down}{Alt Down}{Shift Down}{LWin Down} 
return 

Capslock up:: 
SendInput {Blind}{Ctrl Up}{Alt Up}{Shift Up}{LWin Up} 
return 

;; vim navigation with hyper 
^!+#h:: SendInput {Blind}{Left} 
^!+#h up:: SendInput {Blind}{Left Up} 
^!+#l:: SendInput {Blind}{Right} 
^!+#k:: SendInput {Blind}{Up} 
^!+#j:: SendInput {Blind}{Down} 

;; popular hotkeys with hyper 
^!+#c::^c 
^!+#v::^v 
+0

不是一个编程问题 - ?尝试[苏] –

+0

@PaulR TKS指着我那个网站我会发布了同样的问题,但我想** AutoHotkey的脚本**也是一种编程语言。 – babygau

+1

我想可能是一个编程问题,如果你试图编写一个Autohotkey脚本,它不起作用,在这种情况下,你会在这里发布非工作脚本并寻求帮助解决它。但就目前而言,这个问题更像是一个普通的用户级问题,即“我如何用软件Y做X?”。 –

回答

9

谢谢你,我想出的概率在我自己的,想分享它的情况下,任何人遇到这种概率

#NoEnv ; recommended for performance and compatibility with future autohotkey releases. 
#UseHook 
#InstallKeybdHook 
#SingleInstance force 

SendMode Input 

;; deactivate capslock completely 
SetCapslockState, AlwaysOff 

;; remap capslock to hyper 
;; if capslock is toggled, remap it to esc 

;; note: must use tidle prefix to fire hotkey once it is pressed 
;; not until the hotkey is released 
~Capslock:: 
    ;; must use downtemp to emulate hyper key, you cannot use down in this case 
    ;; according to https://autohotkey.com/docs/commands/Send.htm, downtemp is as same as down except for ctrl/alt/shift/win keys 
    ;; in those cases, downtemp tells subsequent sends that the key is not permanently down, and may be 
    ;; released whenever a keystroke calls for it. 
    ;; for example, Send {Ctrl Downtemp} followed later by Send {Left} would produce a normal {Left} 
    ;; keystroke, not a Ctrl{Left} keystroke 
    Send {Ctrl DownTemp}{Shift DownTemp}{Alt DownTemp}{LWin DownTemp} 
    KeyWait, Capslock 
    Send {Ctrl Up}{Shift Up}{Alt Up}{LWin Up} 
    if (A_PriorKey = "Capslock") { 
     Send {Esc} 
    } 
return 

;; vim navigation with hyper 
~Capslock & h:: Send {Left} 
~Capslock & l:: Send {Right} 
~Capslock & k:: Send {Up} 
~Capslock & j:: Send {Down} 

;; popular hotkeys with hyper 
~Capslock & c:: Send ^{c} 
~Capslock & v:: Send ^{v} 
+0

我在使用Autohotkey的Windows上的Capslock hyper上找到的唯一答案。谢谢@babygau! – snowbound

+0

INSANE。非常感谢!这需要更多赞扬。 VIM的家伙,所以这是一个奖金。我使用相同的组合。 – Vik