فهرست منبع

Remap ESC and CAPS LOCK with native OSX remapping tool

Kevin Heinicke 8 سال پیش
والد
کامیت
a14daa757f
2فایلهای تغییر یافته به همراه13 افزوده شده و 0 حذف شده
  1. 1 0
      install.conf.yaml
  2. 12 0
      osx_startup_script.sh

+ 1 - 0
install.conf.yaml

@@ -3,6 +3,7 @@
 - shell:
     - [git submodule update --init --recursive, Installing submodules]
     - ["mkdir -p ~/.config/nvim/{backup,swap,undo}", Creating nvim backup dirs]
+    - [defaults write com.apple.loginwindow LoginHook osx_startup_script.sh, setup login hook to remap keys]
 
 - link:
     ~/.dotfiles: ''

+ 12 - 0
osx_startup_script.sh

@@ -0,0 +1,12 @@
+hidutil property --set '{
+    "UserKeyMapping": [
+        {
+            "HIDKeyboardModifierMappingSrc": 0x700000039,
+            "HIDKeyboardModifierMappingDst":0x700000029
+        },
+        {
+            "HIDKeyboardModifierMappingSrc":0x700000029,
+            "HIDKeyboardModifierMappingDst":0x700000039
+        }
+    ]
+}'