平时是使用苹果内置键盘以及 HHKB,因为键位有一些不同,设置上也会有一些区别。

Figure 1: Karabiner-Elements

Figure 1: Karabiner-Elements

---
global:
  check_for_updates_on_startup: true
  show_in_menu_bar: true
  show_profile_name_in_menu_bar: true
profiles:
  - complex_modifications:
      parameters:
        basic.simultaneous_threshold_milliseconds: 50
        basic.to_delayed_action_delay_milliseconds: 500
        basic.to_if_alone_timeout_milliseconds: 1000
        basic.to_if_held_down_threshold_milliseconds: 500
        mouse_motion_to_scroll.speed: 100
      rules:
        - description: Change tab to cmd+alt+ctrl if pressed with other keys
          manipulators:
            - from:
                key_code: tab
                modifiers:
                  optional:
                    - any
              to:
                - key_code: left_control
                  modifiers:
                    - left_command
                    - left_option
              to_if_alone:
                - key_code: tab
              type: basic
        - description: Command + Esc to Command + `
          manipulators:
            - from:
                key_code: escape
                modifiers:
                  mandatory:
                    - left_command
              to:
                - key_code: grave_accent_and_tilde
                  modifiers:
                    - left_command
              type: basic
        - description: Change escape to cmd+shift+ctrl if pressed with other keys
          manipulators:
            - from:
                key_code: escape
                modifiers:
                  optional:
                    - any
              to:
                - key_code: left_shift
                  modifiers:
                    - left_command
                    - left_control
              to_if_alone:
                - key_code: escape
              type: basic
        - description: "HHKB RCtF: Function keys"
          manipulators:
            - from:
                key_code: "1"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f1
              type: basic
            - from:
                key_code: "2"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f2
              type: basic
            - from:
                key_code: "3"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f3
              type: basic
            - from:
                key_code: "4"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f4
              type: basic
            - from:
                key_code: "5"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f5
              type: basic
            - from:
                key_code: "6"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f6
              type: basic
            - from:
                key_code: "7"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f7
              type: basic
            - from:
                key_code: "8"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f8
              type: basic
            - from:
                key_code: "9"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f9
              type: basic
            - from:
                key_code: "0"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f10
              type: basic
            - from:
                key_code: hyphen
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f11
              type: basic
            - from:
                key_code: equal_sign
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f12
              type: basic
    devices:
      - disable_built_in_keyboard_if_exists: true
        fn_function_keys: []
        identifiers:
          is_keyboard: true
          is_pointing_device: false
          product_id: 6425
          vendor_id: 1241
        ignore: false
        manipulate_caps_lock_led: false
        simple_modifications: []
      - disable_built_in_keyboard_if_exists: true
        fn_function_keys: []
        identifiers:
          is_keyboard: true
          is_pointing_device: false
          product_id: 256
          vendor_id: 2131
        ignore: false
        manipulate_caps_lock_led: false
        simple_modifications: []
      - disable_built_in_keyboard_if_exists: false
        fn_function_keys: []
        identifiers:
          is_keyboard: true
          is_pointing_device: false
          product_id: 34304
          vendor_id: 1452
        ignore: false
        manipulate_caps_lock_led: true
        simple_modifications: []
    fn_function_keys:
      - from:
          key_code: f1
        to:
          - key_code: display_brightness_decrement
      - from:
          key_code: f2
        to:
          - key_code: display_brightness_increment
      - from:
          key_code: f3
        to:
          - key_code: mission_control
      - from:
          key_code: f4
        to:
          - key_code: launchpad
      - from:
          key_code: f5
        to:
          - key_code: illumination_decrement
      - from:
          key_code: f6
        to:
          - key_code: illumination_increment
      - from:
          key_code: f7
        to:
          - key_code: rewind
      - from:
          key_code: f8
        to:
          - key_code: play_or_pause
      - from:
          key_code: f9
        to:
          - key_code: fastforward
      - from:
          key_code: f10
        to:
          - key_code: mute
      - from:
          key_code: f11
        to:
          - key_code: volume_decrement
      - from:
          key_code: f12
        to:
          - key_code: volume_increment
    name: "⌨️"
    parameters:
      delay_milliseconds_before_open_device: 1000
    selected: true
    simple_modifications: []
    virtual_hid_keyboard:
      caps_lock_delay_milliseconds: 0
      country_code: 0
      indicate_sticky_modifier_keys_state: true
      keyboard_type: ansi
      mouse_key_xy_scale: 100
  - complex_modifications:
      parameters:
        basic.simultaneous_threshold_milliseconds: 50
        basic.to_delayed_action_delay_milliseconds: 500
        basic.to_if_alone_timeout_milliseconds: 1000
        basic.to_if_held_down_threshold_milliseconds: 500
        mouse_motion_to_scroll.speed: 100
      rules:
        - description: Change tab to cmd+alt+ctrl if pressed with other keys
          manipulators:
            - from:
                key_code: tab
                modifiers:
                  optional:
                    - any
              to:
                - key_code: left_control
                  modifiers:
                    - left_command
                    - left_option
              to_if_alone:
                - key_code: tab
              type: basic
        - description:
            Change grave_accent_and_tilde to cmd+shift+ctrl if pressed with
            other keys
          manipulators:
            - from:
                key_code: grave_accent_and_tilde
                modifiers:
                  optional:
                    - any
              to:
                - key_code: left_shift
                  modifiers:
                    - left_command
                    - left_control
              to_if_alone:
                - key_code: grave_accent_and_tilde
              type: basic
        - description: "HHKB RCtF: Function keys"
          manipulators:
            - from:
                key_code: "1"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f1
              type: basic
            - from:
                key_code: "2"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f2
              type: basic
            - from:
                key_code: "3"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f3
              type: basic
            - from:
                key_code: "4"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f4
              type: basic
            - from:
                key_code: "5"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f5
              type: basic
            - from:
                key_code: "6"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f6
              type: basic
            - from:
                key_code: "7"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f7
              type: basic
            - from:
                key_code: "8"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f8
              type: basic
            - from:
                key_code: "9"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f9
              type: basic
            - from:
                key_code: "0"
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f10
              type: basic
            - from:
                key_code: hyphen
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f11
              type: basic
            - from:
                key_code: equal_sign
                modifiers:
                  mandatory:
                    - right_command
              to:
                - key_code: f12
              type: basic
    devices: []
    fn_function_keys:
      - from:
          key_code: f1
        to:
          - consumer_key_code: display_brightness_decrement
      - from:
          key_code: f2
        to:
          - consumer_key_code: display_brightness_increment
      - from:
          key_code: f3
        to:
          - key_code: mission_control
      - from:
          key_code: f4
        to:
          - key_code: launchpad
      - from:
          key_code: f5
        to:
          - key_code: illumination_decrement
      - from:
          key_code: f6
        to:
          - key_code: illumination_increment
      - from:
          key_code: f7
        to:
          - consumer_key_code: rewind
      - from:
          key_code: f8
        to:
          - consumer_key_code: play_or_pause
      - from:
          key_code: f9
        to:
          - consumer_key_code: fastforward
      - from:
          key_code: f10
        to:
          - consumer_key_code: mute
      - from:
          key_code: f11
        to:
          - consumer_key_code: volume_decrement
      - from:
          key_code: f12
        to:
          - consumer_key_code: volume_increment
    name: ""
    parameters:
      delay_milliseconds_before_open_device: 1000
    selected: false
    simple_modifications:
      - from:
          key_code: caps_lock
        to:
          - key_code: left_control
    virtual_hid_keyboard:
      country_code: 0
      indicate_sticky_modifier_keys_state: true
      mouse_key_xy_scale: 100

Links to this note