Skip to content

Instantly share code, notes, and snippets.

@jhorology
Created September 18, 2021 07:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhorology/3a90ee94f84db95fe40a606f6a28eb33 to your computer and use it in GitHub Desktop.
Save jhorology/3a90ee94f84db95fe40a606f6a28eb33 to your computer and use it in GitHub Desktop.
karabiner-elements complex modifications for Keychron K7
{
"title": "Keychron K7 Mac mode",
"rules": [
{
"description": "K7 Fn2 + ESC: Toggle swapping ESC/backtick(default).",
"manipulators": [
{
"description": "Enable swapping ESC/backtick",
"type": "basic",
"from": {
"key_code": "grave_accent_and_tilde",
"modifiers": {
"mandatory": ["fn", "left_shift"]
}
},
"to": [
{
"set_notification_message": {
"id": "keychron_k7_swap_esc_enabled_message",
"text": "Swapping ESC/backtick is enabled."
}
},
{
"set_variable": {
"name": "keychron_k7_swap_esc_disabled",
"value": 0
}
}
],
"to_after_key_up": [
{
"set_notification_message": {
"id": "keychron_k7_swap_esc_enabled_message",
"text": ""
}
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_swap_esc_disabled",
"value": 1
}
]
},
{
"description": "Disable swapping ESC/backtick",
"type": "basic",
"from": {
"key_code": "grave_accent_and_tilde",
"modifiers": {
"mandatory": ["fn", "shift"]
}
},
"to": [
{
"set_notification_message": {
"id": "keychron_k7_swap_esc_disabled_message",
"text": "Swapping ESC/backtick is disabled."
}
},
{
"set_variable": {
"name": "keychron_k7_swap_esc_disabled",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_notification_message": {
"id": "keychron_k7_swap_esc_disabled_message",
"text": ""
}
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_unless",
"name": "keychron_k7_swap_esc_disabled",
"value": 1
}
]
},
{
"description": "remap ESC -> backtick",
"type": "basic",
"from": {
"key_code": "escape",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "grave_accent_and_tilde"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_unless",
"name": "keychron_k7_swap_esc_disabled",
"value": 1
}
]
},
{
"description": "remap backtick -> ESC",
"type": "basic",
"from": {
"key_code": "grave_accent_and_tilde",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "escape"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_unless",
"name": "keychron_k7_swap_esc_disabled",
"value": 1
}
]
}
]
},
{
"description": "K7 Fn2 + Page Up: Toggle remapping Caps Lock to Control(default).",
"manipulators": [
{
"description": "Enable remapping Caps Lock to Left Control",
"type": "basic",
"from": {
"key_code": "page_up",
"modifiers": {
"mandatory": ["fn"]
}
},
"to": [
{
"set_variable": {
"name": "keychron_k7_remap_caps_lock_to_left_control_disabled",
"value": 0
}
},
{
"set_notification_message": {
"id": "keychron_k7_remap_left_control_to_caps_lock_enabled_message",
"text": "Remapping Left Control to Caps Lock is enabled."
}
}
],
"to_after_key_up": [
{
"set_notification_message": {
"id": "keychron_k7_remap_left_control_to_caps_lock_enabled_message",
"text": ""
}
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_unless",
"name": "keychron_k7_remap_caps_lock_to_left_control_disabled",
"value": 0
}
]
},
{
"description": "Disable remapping caps_lock to left_control",
"type": "basic",
"from": {
"key_code": "page_up",
"modifiers": {
"mandatory": ["fn"]
}
},
"to": [
{
"set_variable": {
"name": "keychron_k7_remap_caps_lock_to_left_control_disabled",
"value": 1
}
},
{
"set_notification_message": {
"id": "keychron_k7_remap_left_control_to_caps_lock_disabled_message",
"text": "Remapping left_control to caps_lock is disabled."
}
}
],
"to_after_key_up": [
{
"set_notification_message": {
"id": "keychron_k7_remap_left_control_to_caps_lock_disabled_message",
"text": ""
}
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_unless",
"name": "keychron_k7_remap_caps_lock_to_left_control_disabled",
"value": 1
}
]
},
{
"description": "remap caps_lock to left_control",
"type": "basic",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "left_control"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_unless",
"name": "keychron_k7_remap_caps_lock_to_left_control_disabled",
"value": 1
}
]
}
]
},
{
"description": "K7 Fn2 + Right Command: Toggle remapping Right Command(default) to Option.",
"manipulators": [
{
"description": "Enable remapping Right Command to Option.",
"type": "basic",
"from": {
"key_code": "right_command",
"modifiers": {
"mandatory": ["fn"]
}
},
"to": [
{
"set_notification_message": {
"id": "keychron_k7_remap_right_command_to_option_enabled_message",
"text": "Remapping Right Command to Option is enabled."
}
},
{
"set_variable": {
"name": "keychron_k7_remap_right_command_to_option_enabled",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_notification_message": {
"id": "keychron_k7_remap_right_command_to_option_enabled_message",
"text": ""
}
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_unless",
"name": "keychron_k7_remap_right_command_to_option_enabled",
"value": 1
}
]
},
{
"description": "Disable remapping Right Command to Option.",
"type": "basic",
"from": {
"key_code": "right_command",
"modifiers": {
"mandatory": ["fn"]
}
},
"to": [
{
"set_notification_message": {
"id": "keychron_k7_remap_right_command_to_option_disabled_message",
"text": "Remapping Right Command is disabled."
}
},
{
"set_variable": {
"name": "keychron_k7_remap_right_command_to_option_enabled",
"value": 0
}
}
],
"to_after_key_up": [
{
"set_notification_message": {
"id": "keychron_k7_remap_right_command_to_option_disabled_message",
"text": ""
}
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_remap_right_command_to_option_enabled",
"value": 1
}
]
},
{
"description": "remap Right Command-> Right Option",
"type": "basic",
"from": {
"key_code": "right_command",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "right_option"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_remap_right_command_to_option_enabled",
"value": 1
}
]
}
]
},
{
"description": "K7 Fn2 + Left Command: Toggle swapping Left Command/Option.",
"manipulators": [
{
"description": "Enable swapping Left Command/Option",
"type": "basic",
"from": {
"key_code": "left_command",
"modifiers": {
"mandatory": ["fn"]
}
},
"to": [
{
"set_notification_message": {
"id": "keychron_k7_swap_left_command_option_enabled_message",
"text": "Swapping Left Command/Option is enabled."
}
},
{
"set_variable": {
"name": "keychron_k7_swap_left_command_option_enabled",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_notification_message": {
"id": "keychron_k7_swap_left_command_option_enabled_message",
"text": ""
}
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_unless",
"name": "keychron_k7_swap_left_command_option_enabled",
"value": 1
}
]
},
{
"description": "Disable swapping Left Command/Option",
"type": "basic",
"from": {
"key_code": "left_command",
"modifiers": {
"mandatory": ["fn"]
}
},
"to": [
{
"set_notification_message": {
"id": "keychron_k7_swap_left_command_option_disabled_message",
"text": "Swapping Left Command/Option is disabled."
}
},
{
"set_variable": {
"name": "keychron_k7_swap_left_command_option_enabled",
"value": 0
}
}
],
"to_after_key_up": [
{
"set_notification_message": {
"id": "keychron_k7_swap_left_command_option_disabled_message",
"text": ""
}
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_swap_left_command_option_enabled",
"value": 1
}
]
},
{
"description": "remap Left Command -> Option",
"type": "basic",
"from": {
"key_code": "left_command",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "left_option"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_swap_left_command_option_enabled",
"value": 1
}
]
},
{
"description": "remap Left Option -> Command",
"type": "basic",
"from": {
"key_code": "left_option",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "left_command"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_swap_left_command_option_enabled",
"value": 1
}
]
}
]
},
{
"description": "K7 Fn2 + Left Control: Rotate remapping Control to [Caps Lock(default), Left Control, Globe/Fn].",
"manipulators": [
{
"description": "Set mode to 0:Caps Lock",
"type": "basic",
"from": {
"key_code": "left_control",
"modifiers": {
"mandatory": ["fn"]
}
},
"to": [
{
"set_notification_message": {
"id": "keychron_k7_left_control_mode_caps_lock_message",
"text": "Left Control is remapped to Capps Lock."
}
},
{
"set_variable": {
"name": "keychron_k7_left_control_mode",
"value": 0
}
}
],
"to_after_key_up": [
{
"set_notification_message": {
"id": "keychron_k7_left_control_mode_caps_lock_message",
"text": ""
}
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_left_control_mode",
"value": 2
}
]
},
{
"description": "Set mode to 1:Control",
"type": "basic",
"from": {
"key_code": "left_control",
"modifiers": {
"mandatory": ["fn"]
}
},
"to": [
{
"set_variable": {
"name": "keychron_k7_left_control_mode",
"value": 1
}
},
{
"set_notification_message": {
"id": "keychron_k7_left_control_mode_control_message",
"text": "Remapping Left Control is disabled."
}
}
],
"to_after_key_up": [
{
"set_notification_message": {
"id": "keychron_k7_left_control_mode_control_message",
"text": ""
}
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_unless",
"name": "keychron_k7_left_control_mode",
"value": 1
},
{
"type": "variable_unless",
"name": "keychron_k7_left_control_mode",
"value": 2
}
]
},
{
"description": "set mode to 2:Globe/Fn",
"type": "basic",
"from": {
"key_code": "left_control",
"modifiers": {
"mandatory": ["fn"]
}
},
"to": [
{
"set_variable": {
"name": "keychron_k7_left_control_mode",
"value": 2
}
},
{
"set_notification_message": {
"id": "keychron_k7_left_control_mode_fn_message",
"text": "Left Control is remapped to Globe/Fn."
}
}
],
"to_after_key_up": [
{
"set_notification_message": {
"id": "keychron_k7_left_control_mode_fn_message",
"text": ""
}
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_left_control_mode",
"value": 1
}
]
},
{
"description": "Remap Left Control -> Caps Lock",
"type": "basic",
"from": {
"key_code": "left_control",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "caps_lock"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_unless",
"name": "keychron_k7_left_control_mode",
"value": 1
},
{
"type": "variable_unless",
"name": "keychron_k7_left_control_mode",
"value": 2
}
]
},
{
"description": "remap Left Control -> Globe/Fn",
"type": "basic",
"from": {
"key_code": "left_control",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"apple_vendor_top_case_key_code": "keyboard_fn"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_left_control_mode",
"value": 2
}
]
}
]
},
{
"description": "K7 Fn2 + Q/W/E: Select monitor port [DisplayPort, HDMI1, HDMI2].",
"manipulators": [
{
"description": "Select DisplayPort",
"type": "basic",
"from": {
"key_code": "q",
"modifiers": {
"mandatory": ["fn"]
}
},
"to": [
{
"shell_command": "/usr/local/bin/ddcctl -d 1 -i 15"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
}
]
},
{
"description": "Select HDMI1",
"type": "basic",
"from": {
"key_code": "w",
"modifiers": {
"mandatory": ["fn"]
}
},
"to": [
{
"shell_command": "/usr/local/bin/ddcctl -d 1 -i 17"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
}
]
},
{
"description": "Select HDMI2",
"type": "basic",
"from": {
"key_code": "e",
"modifiers": {
"mandatory": ["fn"]
}
},
"to": [
{
"shell_command": "/usr/local/bin/ddcctl -d 1 -i 18"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
}
]
}
]
},
{
"description": "K7 Fn2 + Page Down: Toggle enabling HHKB-like Fn Layer",
"manipulators": [
{
"description": "Enable HHKB Fn Layer",
"type": "basic",
"from": {
"key_code": "page_down",
"modifiers": {
"mandatory": ["fn"]
}
},
"to": [
{
"set_variable": {
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
},
{
"set_notification_message": {
"id": "keychron_k7_swap_hhkb_layer_enabled_message",
"text": "HHKB-like Fn layer is enabled."
}
}
],
"to_after_key_up": [
{
"set_notification_message": {
"id": "keychron_k7_swap_hhkb_layer_enabled_message",
"text": ""
}
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_unless",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Disable HHKB Fn Layer",
"type": "basic",
"from": {
"key_code": "page_down",
"modifiers": {
"mandatory": ["fn"]
}
},
"to": [
{
"set_variable": {
"name": "keychron_k7_hhkb_layer_enabled",
"value": 0
}
},
{
"set_notification_message": {
"id": "keychron_k7_swap_hhkb_layer_disabled_message",
"text": "HHKB-like Fn layer is disabled."
}
}
],
"to_after_key_up": [
{
"set_notification_message": {
"id": "keychron_k7_swap_hhkb_layer_disabled_message",
"text": ""
}
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Up Arrow to Fn2(Apple Fn)",
"type": "basic",
"from": {
"key_code": "up_arrow",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"apple_vendor_top_case_key_code": "keyboard_fn"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + Backspace to Ins",
"type": "basic",
"from": {
"key_code": "delete_or_backspace",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "insert"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + tab to Caps Lock",
"type": "basic",
"from": {
"key_code": "tab",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "caps_lock"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + i to Print Screen",
"type": "basic",
"from": {
"key_code": "i",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "print_screen"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + o to Scroll Lock",
"type": "basic",
"from": {
"key_code": "o",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "scroll_lock"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + p to Pause",
"type": "basic",
"from": {
"key_code": "p",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "pause"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + Open Bracket([) to Up Arrow",
"type": "basic",
"from": {
"key_code": "open_bracket",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + a to Vol Down",
"type": "basic",
"from": {
"key_code": "a",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "volume_decrement"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + s to Vol Up",
"type": "basic",
"from": {
"key_code": "s",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "volume_increment"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + d to Mute",
"type": "basic",
"from": {
"key_code": "d",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "mute"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + f to Eject",
"type": "basic",
"from": {
"key_code": "f",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "eject"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + h to Keypad Asterisk(*)",
"type": "basic",
"from": {
"key_code": "h",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "keypad_asterisk"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + j to Keypad Slash(/)",
"type": "basic",
"from": {
"key_code": "j",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "keypad_slash"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + k to Home",
"type": "basic",
"from": {
"key_code": "k",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "home"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + l to Page Up",
"type": "basic",
"from": {
"key_code": "l",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "page_up"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + Semicolon(;) to Left Arrow",
"type": "basic",
"from": {
"key_code": "semicolon",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + Quote(\") to Right Arrow",
"type": "basic",
"from": {
"key_code": "quote",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + n to Keypad Plus(+)",
"type": "basic",
"from": {
"key_code": "n",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "keypad_plus"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + m to Keypad hyphen(-)",
"type": "basic",
"from": {
"key_code": "m",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "keypad_hyphen"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + Comma(,) to End",
"type": "basic",
"from": {
"key_code": "comma",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "end"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + Period(.) to Page Down",
"type": "basic",
"from": {
"key_code": "period",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "page_down"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
},
{
"description": "Remap Fn + Slash(/) to Down Arrow",
"type": "basic",
"from": {
"key_code": "slash",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
},
{
"type": "variable_if",
"name": "keychron_k7_hhkb_layer_enabled",
"value": 1
}
]
}
]
},
{
"description": "K7 Fn2 + R: Reset variables.",
"manipulators": [
{
"description": "Reset variables.",
"type": "basic",
"from": {
"key_code": "r",
"modifiers": {
"mandatory": ["fn"],
"optional": ["any"]
}
},
"to": [
{
"set_variable": {
"name": "keychron_k7_swap_esc_disabled",
"value": 0
}
},
{
"set_variable": {
"name": "keychron_k7_remap_caps_lock_to_left_control_disabled",
"value": 0
}
},
{
"set_variable": {
"name": "keychron_k7_remap_right_command_to_option_enabled",
"value": 0
}
},
{
"set_variable": {
"name": "keychron_k7_swap_left_command_option_enabled",
"value": 0
}
},
{
"set_variable": {
"name": "keychron_k7_left_control_mode",
"value": 0
}
},
{
"set_variable": {
"name": "keychron_k7_hhkb_layer_enabled",
"value": 0
}
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1452,
"product_id": 591,
"description": "Keychron K7"
}
]
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment