Skip to content

Instantly share code, notes, and snippets.

@jomifepe
Last active July 7, 2022 11:48
Show Gist options
  • Save jomifepe/ca4bbc92a8fb63457f8c3ef226d3d6a1 to your computer and use it in GitHub Desktop.
Save jomifepe/ca4bbc92a8fb63457f8c3ef226d3d6a1 to your computer and use it in GitHub Desktop.
MacOS Karabiner - Ducky One 2 Skyline
{
"title": "Portuguese Layout Fixes ({}, \\|, ~^, ºª, +*)",
"rules": [
{
"description": "Swap Command <-> Control (MANDATORY FOR ALL THE RULES)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_control"
},
"to": {
"key_code": "left_command"
}
},
{
"type": "basic",
"from": {
"key_code": "left_command"
},
"to": {
"key_code": "left_option"
}
},
{
"type": "basic",
"from": {
"key_code": "left_option"
},
"to": {
"key_code": "left_control"
}
}
]
},
{
"description": "Win as Option & Alt as Command",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_command"
},
"to": {
"key_code": "left_option"
}
},
{
"type": "basic",
"from": {
"key_code": "left_option"
},
"to": {
"key_code": "left_command"
}
}
]
},
{
"description": "7 and 0 Curly Brackets",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "7",
"modifiers": {
"mandatory": ["right_alt"]
}
},
"to": [
{
"key_code": "8",
"modifiers": ["left_option", "left_shift"]
}
]
},
{
"type": "basic",
"from": {
"key_code": "0",
"modifiers": {
"mandatory": ["right_alt"]
}
},
"to": [
{
"key_code": "9",
"modifiers": ["left_option", "left_shift"]
}
]
}
]
},
{
"description": "Grave accent and tilde (~^) (quote <-> backslash)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "backslash",
"modifiers": {
"optional": ["any"]
}
},
"to": {
"key_code": "quote"
}
}
]
},
{
"description": "Backslash (\\|) (grave_accent_and_tilde <-> backslash)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "grave_accent_and_tilde",
"modifiers": {
"optional": ["any"]
}
},
"to": {
"key_code": "backslash"
}
}
]
},
{
"description": "Plus and asterisk (+*) (open_bracket <-> equal_sign)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "open_bracket",
"modifiers": {
"optional": ["any"]
}
},
"to": {
"key_code": "equal_sign"
}
}
]
},
{
"description": "Ordinals (ºª) (quote <-> open_bracket)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "quote",
"modifiers": {
"optional": ["any"]
}
},
"to": {
"key_code": "open_bracket"
}
}
]
},
{
"description": "Copy & Paste in Terminals (Ctrl+Shift+C/V)",
"manipulators": [
{
"from": {
"key_code": "c",
"modifiers": {
"mandatory": ["control", "shift"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "c",
"modifiers": ["command"]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "v",
"modifiers": {
"mandatory": ["control", "shift"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "v",
"modifiers": ["command"]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$"
]
}
],
"type": "basic"
}
]
},
{
"description": "Home & End navigation (w/ Ctrl, Shift or both)",
"manipulators": [
{
"from": {
"key_code": "home",
"modifiers": { "optional": ["any"] }
},
"to": [
{
"key_code": "left_arrow",
"modifiers": ["command"]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyper$",
"^org\\.virtualbox\\.app\\.VirtualBoxVM$",
"^com\\.microsoft\\.rdc\\.macos$"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "home",
"modifiers": { "mandatory": ["control"], "optional": ["any"] }
},
"to": [
{
"key_code": "up_arrow",
"modifiers": ["command"]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyper$",
"^org\\.virtualbox\\.app\\.VirtualBoxVM$",
"^com\\.microsoft\\.rdc\\.macos$"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "home",
"modifiers": { "mandatory": ["shift"], "optional": ["any"] }
},
"to": [
{
"key_code": "left_arrow",
"modifiers": ["command", "shift"]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyper$",
"^org\\.virtualbox\\.app\\.VirtualBoxVM$",
"^com\\.microsoft\\.rdc\\.macos$"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "home",
"modifiers": {
"mandatory": ["control", "shift"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "up_arrow",
"modifiers": ["command", "shift"]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyper$",
"^org\\.virtualbox\\.app\\.VirtualBoxVM$",
"^com\\.microsoft\\.rdc\\.macos$"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "end",
"modifiers": { "optional": ["any"] }
},
"to": [
{
"key_code": "right_arrow",
"modifiers": ["command"]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyper$",
"^org\\.virtualbox\\.app\\.VirtualBoxVM$",
"^com\\.microsoft\\.rdc\\.macos$"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "end",
"modifiers": { "mandatory": ["control"], "optional": ["any"] }
},
"to": [
{
"key_code": "down_arrow",
"modifiers": ["command"]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyper$",
"^org\\.virtualbox\\.app\\.VirtualBoxVM$",
"^com\\.microsoft\\.rdc\\.macos$"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "end",
"modifiers": { "mandatory": ["shift"], "optional": ["any"] }
},
"to": [
{
"key_code": "right_arrow",
"modifiers": ["command", "shift"]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyper$",
"^org\\.virtualbox\\.app\\.VirtualBoxVM$",
"^com\\.microsoft\\.rdc\\.macos$"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "end",
"modifiers": {
"mandatory": ["control", "shift"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "down_arrow",
"modifiers": ["command", "shift"]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyper$",
"^org\\.virtualbox\\.app\\.VirtualBoxVM$",
"^com\\.microsoft\\.rdc\\.macos$"
]
}
],
"type": "basic"
}
]
},
{
"description": "Arrow text navigation (Ctrl+Arrows)",
"manipulators": [
{
"from": {
"key_code": "left_arrow",
"modifiers": { "mandatory": ["command"], "optional": ["any"] }
},
"to": [
{
"key_code": "left_arrow",
"modifiers": ["option"]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyper$",
"^org\\.virtualbox\\.app\\.VirtualBoxVM$",
"^com\\.microsoft\\.rdc\\.macos$"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "right_arrow",
"modifiers": { "mandatory": ["command"], "optional": ["any"] }
},
"to": [
{
"key_code": "right_arrow",
"modifiers": ["option"]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyper$",
"^org\\.virtualbox\\.app\\.VirtualBoxVM$",
"^com\\.microsoft\\.rdc\\.macos$"
]
}
],
"type": "basic"
}
]
},
{
"description": "Arrow text selection (Ctrl+Shift+Arrows)",
"manipulators": [
{
"from": {
"key_code": "left_arrow",
"modifiers": {
"mandatory": ["command", "shift"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": ["option", "shift"]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyper$",
"^org\\.virtualbox\\.app\\.VirtualBoxVM$",
"^com\\.microsoft\\.rdc\\.macos$"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "right_arrow",
"modifiers": {
"mandatory": ["command", "shift"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": ["option", "shift"]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyper$",
"^org\\.virtualbox\\.app\\.VirtualBoxVM$",
"^com\\.microsoft\\.rdc\\.macos$"
]
}
],
"type": "basic"
}
]
},
{
"description": "Word deletion (Ctrl+Backspace/Delete)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "delete_or_backspace",
"modifiers": { "mandatory": ["option"], "optional": ["any"] }
},
"to": [
{
"key_code": "delete_or_backspace",
"modifiers": ["command"]
}
]
},
{
"type": "basic",
"from": {
"key_code": "backspace",
"modifiers": {
"mandatory": ["fn", "option"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "delete_forward",
"modifiers": ["command"]
}
]
}
]
},
{
"description": "Alt + Tab (command tab)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "tab",
"modifiers": {
"mandatory": ["left_control"],
"optional": ["any"]
}
},
"to": [
{
"key_code": "tab",
"modifiers": ["left_command"]
}
]
}
]
},
{
"description": "Ctrl + [Shift] + Tab (Browser tab navigation)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "tab",
"modifiers": {
"mandatory": ["left_command"],
"optional": ["left_shift"]
}
},
"to": [
{
"key_code": "tab",
"modifiers": ["left_control"]
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment