![Mac,如何使用 Karabiner 將 control + HJKL 重新對應到左、下、上、右](https://rvso.com/image/1490208/Mac%EF%BC%8C%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20Karabiner%20%E5%B0%87%20control%20%2B%20HJKL%20%E9%87%8D%E6%96%B0%E5%B0%8D%E6%87%89%E5%88%B0%E5%B7%A6%E3%80%81%E4%B8%8B%E3%80%81%E4%B8%8A%E3%80%81%E5%8F%B3.png)
我剛剛下載了 Karabiner,但沒有找到我需要的重新映射。所以我想創建自己的重映射規則,但不知道如何。
答案1
自己做的,其實很簡單。
<?xml version="1.0"?>
<root>
<item>
<name>Ctrl + HJKL to Left/Down/Up/Right</name>
<identifier>private.ctrl_hjkl</identifier>
<autogen>__KeyToKey__ KeyCode::H, ModifierFlag::CONTROL_L, KeyCode::CURSOR_LEFT</autogen>
<autogen>__KeyToKey__ KeyCode::J, ModifierFlag::CONTROL_L, KeyCode::CURSOR_DOWN</autogen>
<autogen>__KeyToKey__ KeyCode::K, ModifierFlag::CONTROL_L, KeyCode::CURSOR_UP</autogen>
<autogen>__KeyToKey__ KeyCode::L, ModifierFlag::CONTROL_L, KeyCode::CURSOR_RIGHT</autogen>
</item>
將這些程式碼貼到資料夾下的 private.xml 中:
/Library/Application Support/Karabiner
完畢。