Skip to content

Instantly share code, notes, and snippets.

@1yx
Forked from jimpsson/disable_cmd_tab_or_q.json
Last active December 12, 2023 02:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1yx/b58865feeba460af4d907154fa683371 to your computer and use it in GitHub Desktop.
Save 1yx/b58865feeba460af4d907154fa683371 to your computer and use it in GitHub Desktop.
Redefine builtin MacOS default keyboard shortcuts with Karabiner-Elements to vk_none effectively making the keybinding disabled. In Karabiner-Elements vk_none means VirtualKeyboard None, use it when you want to disable any keybinding. This example disables Application Switcher (command+tab), and/or Application Quit keyboard shortcut (command+q).
{
"title": "Disable MacOS builtin default keybinding (cmd + w)",
"rules": [
{
"description": "Disable Application Window Close",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "w",
"modifiers": {
"mandatory": ["command"]
}
},
"to": [
{
"key_code": "vk_none"
}
]
}
]
}
]
}

DISABLE CMD+TAB AND/OR CMD+Q

Redefine your builtin MacOS default keyboard shortcuts using Karabiner-Elements. Binding two specific keybindings to vk_none resulting in effectively disabling the named keybinding.

In Karabiner-Elements the vk_none keycode means virtualkeyboard none. Use it when you want to disable any existing keybinding, or perhaps as some boilerplate for your not yet implemented keybindings.

This demo shows you how to disable the application switcher (command+tab), and/or application quit (command+q) keybinding. Nothing fancy about this config at all, but I have some ideas on how to improve this.

I will update this gist as I update my local configuration.

@1yx
Copy link
Author

1yx commented Dec 12, 2023

重写了两份配置,现在在用。
https://pastebin.com/0DtNnMd6
https://pastebin.com/J8DHuawd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment