Skip to content

Commit

Permalink
Merge pull request #1327 from hnakamur/add_ctrl_k_for_microsoft_offic…
Browse files Browse the repository at this point in the history
…e_in_emacs_key_bindings

Add Ctrl-k for Microsoft Office in emacs_key_bindings
  • Loading branch information
tekezo committed Feb 28, 2023
2 parents c7f83fb + ed32b8b commit 1dc618f
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 0 deletions.
78 changes: 78 additions & 0 deletions public/json/emacs_key_bindings.json
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,42 @@
}
]
},
{
"type": "basic",
"from": {
"key_code": "k",
"modifiers": {
"mandatory": [
"control"
],
"optional": [
"caps_lock",
"shift"
]
}
},
"to": [
{
"key_code": "end",
"modifiers": [
"left_shift"
]
},
{
"key_code": "delete_forward"
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.microsoft\\.Excel$",
"^com\\.microsoft\\.Powerpoint$",
"^com\\.microsoft\\.Word$"
]
}
]
},
{
"type": "basic",
"from": {
Expand Down Expand Up @@ -1832,6 +1868,48 @@
}
]
},
{
"type": "basic",
"from": {
"key_code": "k",
"modifiers": {
"mandatory": [
"control"
],
"optional": [
"caps_lock",
"shift"
]
}
},
"to": [
{
"key_code": "end",
"modifiers": [
"left_shift"
]
},
{
"key_code": "delete_forward"
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.microsoft\\.Excel$",
"^com\\.microsoft\\.Powerpoint$",
"^com\\.microsoft\\.Word$"
]
},
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.microsoft\\.VSCode$"
]
}
]
},
{
"type": "basic",
"from": {
Expand Down
17 changes: 17 additions & 0 deletions src/json/emacs_key_bindings.json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,23 @@ def control_keys(options)
'to' => [{ 'key_code' => 'end' }],
'conditions' => [Karabiner.frontmost_application_if(['microsoft_office'])] + options[:frontmost_application_if],
},
{
'type' => 'basic',
'from' => {
'key_code' => 'k',
'modifiers' => Karabiner.from_modifiers(['control'], %w[caps_lock shift]),
},
'to' => [
{
'key_code' => 'end',
'modifiers' => ['left_shift'],
},
{
'key_code' => 'delete_forward',
},
],
'conditions' => [Karabiner.frontmost_application_if(['microsoft_office'])] + options[:frontmost_application_if],
},
{
'type' => 'basic',
'from' => {
Expand Down

0 comments on commit 1dc618f

Please sign in to comment.