V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Joway
V2EX  ›  macOS

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

  •  4
     
  •   Joway · 2020-06-28 11:15:54 +08:00 · 4183 次点击
    这是一个创建于 1397 天前的主题,其中的信息可能已经有所发展或是发生改变。

    用 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 条回复    2020-11-17 16:31:28 +08:00
    find456789
        1
    find456789  
       2020-06-28 12:10:53 +08:00
    感谢分享,我的也坏了,我没升级系统也坏了, 不知道为啥
    find456789
        2
    find456789  
       2020-06-28 12:11:43 +08:00
    贴个连接 https://juejin.im/post/5b5551fa6fb9a04fa671a8f2 他是加到开机任务的: ~/Library/LaunchAgents/.plist
    finalshot
        3
    finalshot  
       2020-09-24 13:43:32 +08:00
    好像无法设置 f3-> mission control,f4-> launchpad, 有解吗?
    zycode277
        4
    zycode277  
       2020-11-17 16:31:28 +08:00
    已经更新了, 去官网下吧
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5345 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 07:57 · PVG 15:57 · LAX 00:57 · JFK 03:57
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.