V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Joway
V2EX  ›  macOS

MacOS Big Sur 下解决 Karabiner-Elements 失效问题

  •  4
     
  •   Joway · Jun 28, 2020 · 4821 views
    This topic created in 2130 days ago, the information mentioned may be changed or developed.

    用 Apple 自带的 hidutil 来暂时替代了 Karabiner-Elements, 我的场景是把 HHKB 的 left-opt => left-control , left-control => Caps Lock,并且在没有 HHKB 的时候回到系统键盘自带的 mapping 上,示例如下:

    # ~/.zshrc
    function hhkb(){
    	hidutil property --set '{
    	  "UserKeyMapping": [
    	    {
    	      "HIDKeyboardModifierMappingSrc": 0x7000000E0,
    	      "HIDKeyboardModifierMappingDst": 0x700000039
    	    },
    	    {
    	      "HIDKeyboardModifierMappingSrc": 0x7000000E2,
    	      "HIDKeyboardModifierMappingDst": 0x7000000E0
    	    }
    	  ]
    	}'
    }
    
    
    function dishhkb(){
    	hidutil property --set '{
    	  "UserKeyMapping": []
    	}'
    }
    
    

    键值表参考: https://developer.apple.com/library/archive/technotes/tn2450/_index.html

    缺点是连上 HHKB/重启电脑后,要重新执行 hhkb 来激活。

    4 replies    2020-11-17 16:31:28 +08:00
    find456789
        1
    find456789  
       Jun 28, 2020
    感谢分享,我的也坏了,我没升级系统也坏了, 不知道为啥
    find456789
        2
    find456789  
       Jun 28, 2020
    贴个连接 https://juejin.im/post/5b5551fa6fb9a04fa671a8f2 他是加到开机任务的: ~/Library/LaunchAgents/.plist
    finalshot
        3
    finalshot  
       Sep 24, 2020
    好像无法设置 f3-> mission control,f4-> launchpad, 有解吗?
    zycode277
        4
    zycode277  
       Nov 17, 2020
    已经更新了, 去官网下吧
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5103 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 05:40 · PVG 13:40 · LAX 22:40 · JFK 01:40
    ♥ Do have faith in what you're doing.