diff --git a/karabiner/assets/complex_modifications/windows-mappings.json b/karabiner/assets/complex_modifications/windows-mappings.json new file mode 100644 index 0000000..e4c1fce --- /dev/null +++ b/karabiner/assets/complex_modifications/windows-mappings.json @@ -0,0 +1,776 @@ +{ + "rules": [ + { + "description": "Copy, paste, and other general keyboard shortcutes", + "manipulators": [ + { + "type": "basic", + "from": { + "key_code": "x", + "modifiers": { + "mandatory": [ + "control" + ] + } + }, + "to": [ + { + "key_code": "x", + "modifiers": [ + "right_command" + ] + } + ], + "conditions": [ + { + "type": "frontmost_application_unless", + "bundle_identifiers": [ + "^com\\.apple\\.Terminal$", + "^com\\.googlecode\\.iterm2$" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "c", + "modifiers": { + "mandatory": [ + "control" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "right_command" + ] + } + ], + "conditions": [ + { + "type": "frontmost_application_unless", + "bundle_identifiers": [ + "^com\\.apple\\.Terminal$", + "^com\\.googlecode\\.iterm2$" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "control" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "right_command" + ] + } + ], + "conditions": [ + { + "type": "frontmost_application_unless", + "bundle_identifiers": [ + "^com\\.apple\\.Terminal$", + "^com\\.googlecode\\.iterm2$" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "v", + "modifiers": { + "mandatory": [ + "control" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "right_command" + ] + } + ], + "conditions": [ + { + "type": "frontmost_application_unless", + "bundle_identifiers": [ + "^com\\.apple\\.Terminal$", + "^com\\.googlecode\\.iterm2$" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "insert", + "modifiers": { + "mandatory": [ + "shift" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "right_command" + ] + } + ], + "conditions": [ + { + "type": "frontmost_application_unless", + "bundle_identifiers": [ + "^com\\.apple\\.Terminal$", + "^com\\.googlecode\\.iterm2$" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "z", + "modifiers": { + "mandatory": [ + "control" + ] + } + }, + "to": [ + { + "key_code": "z", + "modifiers": [ + "right_command\u2020" + ] + } + ], + "conditions": [ + { + "type": "frontmost_application_unless", + "bundle_identifiers": [ + "^com\\.apple\\.Terminal$", + "^com\\.googlecode\\.iterm2$" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "tab", + "modifiers": { + "mandatory": [ + "option" + ] + } + }, + "to": [ + { + "key_code": "tab", + "modifiers": [ + "right_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "f4", + "modifiers": { + "mandatory": [ + "option" + ] + } + }, + "to": [ + { + "key_code": "q", + "modifiers": [ + "right_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "q", + "modifiers": { + "mandatory": [ + "control" + ] + } + }, + "to": [ + { + "key_code": "q", + "modifiers": [ + "right_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "f2" + }, + "to": [ + { + "key_code": "return" + } + ], + "conditions": [ + { + "type": "frontmost_application_if", + "bundle_identifiers": [ + "^com\\.apple\\.finder$" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "f3" + }, + "to": [ + { + "key_code": "f", + "modifiers": [ + "right_command" + ] + } + ], + "conditions": [ + { + "type": "frontmost_application_if", + "bundle_identifiers": [ + "^com\\.apple\\.finder$" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "f4" + }, + "to": [ + { + "key_code": "g", + "modifiers": [ + "right_command", + "shift" + ] + } + ], + "conditions": [ + { + "type": "frontmost_application_if", + "bundle_identifiers": [ + "^com\\.apple\\.finder$" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "f5" + }, + "to": [ + { + "key_code": "r", + "modifiers": [ + "right_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "f10" + }, + "to": [ + { + "key_code": "f2", + "modifiers": [ + "right_control" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "e", + "modifiers": { + "mandatory": [ + "option" + ] + } + }, + "to": [ + { + "key_code": "f2", + "modifiers": [ + "right_control" + ] + }, + { + "key_code": "e" + }, + { + "key_code": "down_arrow" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "f", + "modifiers": { + "mandatory": [ + "option" + ] + } + }, + "to": [ + { + "key_code": "f2", + "modifiers": [ + "right_control" + ] + }, + { + "key_code": "f" + }, + { + "key_code": "down_arrow" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "g", + "modifiers": { + "mandatory": [ + "option" + ] + } + }, + "to": [ + { + "key_code": "f2", + "modifiers": [ + "right_control" + ] + }, + { + "key_code": "g" + }, + { + "key_code": "down_arrow" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "h", + "modifiers": { + "mandatory": [ + "option" + ] + } + }, + "to": [ + { + "key_code": "f2", + "modifiers": [ + "right_control" + ] + }, + { + "key_code": "h" + }, + { + "key_code": "down_arrow" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "i", + "modifiers": { + "mandatory": [ + "option" + ] + } + }, + "to": [ + { + "key_code": "f2", + "modifiers": [ + "right_control" + ] + }, + { + "key_code": "i" + }, + { + "key_code": "down_arrow" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "r", + "modifiers": { + "mandatory": [ + "option" + ] + } + }, + "to": [ + { + "key_code": "f2", + "modifiers": [ + "right_control" + ] + }, + { + "key_code": "r" + }, + { + "key_code": "down_arrow" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "s", + "modifiers": { + "mandatory": [ + "option" + ] + } + }, + "to": [ + { + "key_code": "f2", + "modifiers": [ + "right_control" + ] + }, + { + "key_code": "s" + }, + { + "key_code": "down_arrow" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "t", + "modifiers": { + "mandatory": [ + "option" + ] + } + }, + "to": [ + { + "key_code": "f2", + "modifiers": [ + "right_control" + ] + }, + { + "key_code": "t" + }, + { + "key_code": "down_arrow" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "v", + "modifiers": { + "mandatory": [ + "option" + ] + } + }, + "to": [ + { + "key_code": "f2", + "modifiers": [ + "right_control" + ] + }, + { + "key_code": "v" + }, + { + "key_code": "down_arrow" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "w", + "modifiers": { + "mandatory": [ + "option" + ] + } + }, + "to": [ + { + "key_code": "f2", + "modifiers": [ + "right_control" + ] + }, + { + "key_code": "w" + }, + { + "key_code": "down_arrow" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": [ + "option" + ] + } + }, + "to": [ + { + "key_code": "i", + "modifiers": [ + "right_command" + ] + } + ], + "conditions": [ + { + "type": "frontmost_application_if", + "bundle_identifiers": [ + "^com\\.apple\\.finder$" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "spacebar", + "modifiers": { + "mandatory": [ + "option" + ] + } + }, + "to": [ + { + "key_code": "button2" + } + ] + } + ] + }, + { + "description": "Windows logo keyboard shortcuts", + "manipulators": [ + { + "type": "basic", + "from": { + "key_code": "d", + "modifiers": { + "mandatory": [ + "command" + ] + } + }, + "to": [ + { + "key_code": "f11" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "command" + ] + } + }, + "to": [ + { + "key_code": "q", + "modifiers": [ + "right_command", + "right_control" + ] + } + ] + } + ] + }, + { + "description": "Command Prompt keyboard shortcuts", + "manipulators": [ + { + "type": "basic", + "from": { + "key_code": "x", + "modifiers": { + "mandatory": [ + "control", + "shift" + ] + } + }, + "to": [ + { + "key_code": "x", + "modifiers": [ + "right_command" + ] + } + ], + "conditions": [ + { + "type": "frontmost_application_if", + "bundle_identifiers": [ + "^com\\.apple\\.Terminal$", + "^com\\.googlecode\\.iterm2$" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "c", + "modifiers": { + "mandatory": [ + "control", + "shift" + ] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "right_command" + ] + } + ], + "conditions": [ + { + "type": "frontmost_application_if", + "bundle_identifiers": [ + "^com\\.apple\\.Terminal$", + "^com\\.googlecode\\.iterm2$" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "v", + "modifiers": { + "mandatory": [ + "control", + "shift" + ] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "right_command" + ] + } + ], + "conditions": [ + { + "type": "frontmost_application_if", + "bundle_identifiers": [ + "^com\\.apple\\.Terminal$", + "^com\\.googlecode\\.iterm2$" + ] + } + ] + } + ] + }, + { + "description": "Disable corresponding macOS shortcuts", + "manipulators": [ + { + "type": "basic", + "from": { + "key_code": "q", + "modifiers": { + "mandatory": [ + "command" + ], + "optional": [ + "control" + ] + } + }, + "to": [ + { + "key_code": "vk_none" + } + ] + } + ] + } + ] +} diff --git a/karabiner/assets/complex_modifications/windows-mappings.py b/karabiner/assets/complex_modifications/windows-mappings.py index 0aeb723..13f65f9 100644 --- a/karabiner/assets/complex_modifications/windows-mappings.py +++ b/karabiner/assets/complex_modifications/windows-mappings.py @@ -138,7 +138,7 @@ ), # ------------------------------------------------------------------ # Alt + Spacebar Open the shortcut menu for the active window. - # TODO: find what Alt + Space does in windows + # N/A # ------------------------------------------------------------------ # Alt + Left arrow Go back. # ------------------------------------------------------------------ @@ -149,20 +149,32 @@ # Alt + Page Down Move down one screen. # ------------------------------------------------------------------ # Ctrl + F4 Close the active document (in apps that are full-screen and let you have multiple documents open at the same time). + mp(fk("f4", ["control"]), [tk("w", ["right_command"])]), + mp(fk("w", ["control"]), [tk("w", ["right_command"])]), # ------------------------------------------------------------------ # Ctrl + A Select all items in a document or window. + mp(fk("a", ["control"]), [tk("a", ["right_command"])]), # ------------------------------------------------------------------ # Ctrl + D (or Delete) Delete the selected item and move it to the Recycle Bin. + mp(fk("d", ["control"]), [tk("d", ["right_command"])]), # ------------------------------------------------------------------ # Ctrl + E Open Search (in most apps). # ------------------------------------------------------------------ # Ctrl + R (or F5) Refresh the active window. + mp(fk("f5", optional=["shift"]), [tk("r", ["right_command"])]), # ------------------------------------------------------------------ # Ctrl + Y Redo an action. + mp(fk("y", ["control"]), [tk("z", ["right_command", "right_shift"])]), + mp( + fk("z", ["control", "shift"]), + [tk("z", ["right_command", "right_shift"])], + ), # ------------------------------------------------------------------ # Ctrl + Right arrow Move the cursor to the beginning of the next word. + mp(fk("right_arrow", ["control"]), [tk("right_arrow", ["option"])]), # ------------------------------------------------------------------ # Ctrl + Left arrow Move the cursor to the beginning of the previous word. + mp(fk("left_arrow", ["control"]), [tk("left_arrow", ["option"])]), # ------------------------------------------------------------------ # Ctrl + Down arrow Move the cursor to the beginning of the next paragraph. # ------------------------------------------------------------------