首页 > 解决方案 > 使用自动热键的分层键盘

问题描述

在使我的键盘分层时,我想删除,键的默认行为。我已经映射CapsLock+j给我,输入。现在,我希望仅,按 BackSpace 和CapsLock+,输入的新行为}。如何使用 AutoHotKey 脚本实现这一点?

PS:我正在尝试为我的 Mac 和 Windows 机器实现相同的键盘布局。我试图实现的布局非常接近,但不像上面的链接那样 100% 精确。

到目前为止我所拥有的(你可以跳到最后 9 行代码):

#SingleInstance Force 
  
#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. 
  
; For easy access of Control Key 
LAlt::Ctrl 
  
; Use Alt as Snap keys 
CapsLock::Alt 
'::Alt 
  
  
`;::Enter 
,::Backspace 
.::Ctrl 
/::Shift 
  
  
!a:: 
Send, ~ 
return 
!s:: 
Send, =  
return 
!d:: 
Send, ‘   
return 
!f:: 
Send, “  
return 
!g:: 
Send, -  
return 
!z:: 
Send, <  
return 
!x:: 
Send, {{} 
return 
!c:: 
Send, [  
return 
!v:: 
Send, (  
return 
!b:: 
Send, /  
return 
  
  
!{:: 
Send, | 
return 
!}:: 
Send, Ctrl  
return 
!h:: 
Send, {+}  
return 
!j:: 
Send, ,  
return 
!k:: 
Send, .  
return 
!l:: 
Send, {Esc} 
return 
; the following will now work currently cause ; has already been mapped to Enter key, find a solution 
!`;:: 
Send, ?  
return 
!n:: 
Send, \  
return 
!m:: 
Send, )  
return 
!,:: 
Send, ] 
return 
!.:: 
Send, {}} 
return 
!/:: 
Send, >  
return 


 

标签: windowskeyboardautohotkey

解决方案


推荐阅读