Skip to content

Instantly share code, notes, and snippets.

@llivejo
Created May 29, 2021 20:39
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 llivejo/684347b40ff88a77781a5ec21add7aa2 to your computer and use it in GitHub Desktop.
Save llivejo/684347b40ff88a77781a5ec21add7aa2 to your computer and use it in GitHub Desktop.
CapsLock switch to EN, Shift-CapsLock to RU - with Karabiner Elements in MacOS
{
"title": "[Shift-]Capslock changes to correct layout",
"rules": [
{
"description": "Capslock to EN if in RU",
"manipulators": [
{
"conditions": [
{
"type": "input_source_if",
"input_sources": [
{
"language": "ru"
}
]
}
],
"type": "basic",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"caps_lock"
]
}
},
"to": [
{
"select_input_source": {
"language": "en"
}
}
]
}
]
},
{
"description": "Disable Capslock if already in EN",
"manipulators": [
{
"conditions": [
{
"type": "input_source_if",
"input_sources": [
{
"language": "en"
}
]
}
],
"type": "basic",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "out"
}
]
}
]
},
{
"description": "Shift-Capslock to RU if in EN",
"manipulators": [
{
"conditions": [
{
"type": "input_source_if",
"input_sources": [
{
"language": "en"
}
]
}
],
"type": "basic",
"from": {
"key_code": "caps_lock",
"modifiers": {
"mandatory": [
"left_shift"
]
}
},
"to": [
{
"select_input_source": {
"language": "ru"
}
}
]
}
]
},
{
"description": "Disable Shift-Capslock if already in RU",
"manipulators": [
{
"conditions": [
{
"type": "input_source_if",
"input_sources": [
{
"language": "ru"
}
]
}
],
"type": "basic",
"from": {
"key_code": "caps_lock",
"modifiers": {
"mandatory": [
"left_shift"
]
}
},
"to": [
{
"key_code": "out"
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment