我的Karabiner-Elements规则设置

记录一下留存备忘(这是.json.erb 文件,需要生成对应的 json 文件才可用)。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
  "title": "Sunn Yao's Personal Configurations",
  "rules": [
    {
      "description": "Change enter to control if pressed with other keys",
      "manipulators": [
        {
          "type": "basic",
          "from": <%= from("return_or_enter", [], ["any"]) %>,
          "to": <%= to([["right_control"]]) %>,
          "to_if_alone": <%= to([["return_or_enter"]]) %>
        }
      ]
    },
    {
      "description": "Change caps_lock to control if pressed with other keys, to escape if pressed alone.",
      "manipulators": [
        {
          "type": "basic",
          "from": <%= from("caps_lock", [], ["any"]) %>,
          "to": <%= to([["left_control"]]) %>,
          "to_if_alone": <%= to([["escape"]]) %>
        }
      ]
    },
    {
      "description": "Post escape if left_control is pressed alone.",
      "manipulators": [
        {
          "type": "basic",
          "from": <%= from("left_control", [], ["any"]) %>,
          "to": <%= to([["left_control"]]) %>,
          "to_if_alone": <%= to([["escape"]]) %>
        }
      ]
    },
    {
      "description": "Change left_shift to Ctrl-\\ if pressed alone in Emacs",
      "manipulators": [
        {
          "type": "basic",
          "from": <%= from("left_shift", [], []) %>,
          "to": <%= to([["left_shift"]]) %>,
          "to_if_alone": <%= to([["backslash", ["left_control"]]]) %>,
          "conditions": [ <%= frontmost_application_if("emacs") %> ]
        }
      ]
    },
    {
      "description": "Change right_shift to Ctrl-\\ if pressed alone in Emacs",
      "manipulators": [
        {
          "type": "basic",
          "from": <%= from("right_shift", [], []) %>,
          "to": <%= to([["right_shift"]]) %>,
          "to_if_alone": <%= to([["backslash", ["left_control"]],]) %>,
          "conditions": [ <%= frontmost_application_if("emacs") %> ]
        }
      ]
     },
    {
      "description": "Change left_gui+spacebar to left_alt+spacebar in Emacs",
      "manipulators": [
        {
          "type": "basic",
          "from": <%= from("spacebar", ["left_gui"], []) %>,
          "to": <%= to([["spacebar", ["left_alt"]]]) %>,
          "conditions": [ <%= frontmost_application_if("emacs") %> ]
        }
      ]
     },
    {
      "description": "Change left_gui+x to left_alt+x in Emacs",
      "manipulators": [
        {
          "type": "basic",
          "from": <%= from("x", ["left_gui"], []) %>,
          "to": <%= to([["x", ["left_alt"]]]) %>,
          "conditions": [ <%= frontmost_application_if("emacs") %> ]
        }
      ]
    }
  ]
}
Licensed under CC BY-NC-SA 4.0
最后更新于 Nov 04, 2019 13:25 +0800
comments powered by Disqus
墩墩家的幸福生活
Built with Hugo
主题 StackJimmy 设计