0

I would like to map Ctrl + Delete on a Windows keyboard to Fn + Opt + Delete on a Macbook keyboard, so it deletes the next word after the cursor.

I can't figure out how to represent Fn + Opt + Delete in the json, how would I modify the following?

{
    "conditions": [{"type": "frontmost_application_unless", "bundle_identifiers": ["^com\\.sublimetext\\.3$"]}],
    "from": {"key_code": "delete_forward", "modifiers": {"mandatory": ["left_control"]}},
    "to": /* What should I put here? */,
    "type": "basic"
}

3 Answers 3

0

Fn is usually evaluated within the keyboard, before transmission. It doesn't generate its own event.

According to Key Codes, Fn Opt ⌥ Backspace ⌫ generates this data...

Key Down
    Characters: 
    Unicode:        63272 / 0xf728
    Keys:       ⌥⌦
    Key Code:   117 / 0x75
    Modifiers:  8913216 / 0x880140 ⓘ

Maybe you could use that to initiate the replacement - I don't use Karabiner so can't test.

*Characters:  doesn't actually generate any printable character on my machine.

2
  • Hm I think 0x75 is just delete_forward in Karabiner, which is Fn + Delete, but need a way to represent Fn + Opt + Delete somehow.
    – simonzack
    Jul 20, 2019 at 13:40
  • It clearly shows opt/forward delete... which is what you actually generate if you hit Fn/opt/back delete. You need to include the modifier code to get the entire command.Get Key Codes (freeware) & try it out for yourself.
    – Tetsujin
    Jul 20, 2019 at 13:43
0

Was actually quite obvious, I have no idea why I didn't try to obvious solution. Took me a couple days to figure it out. All I needed to do was add the Opt/Alt modifier.

{
    "conditions": [{"type": "frontmost_application_unless", "bundle_identifiers": [
        "^com\\.sublimetext\\.3$",
        "^com\\.google\\.Chrome$",
        "^com\\.jetbrains\\.pycharm$"
    ]}],
    "from": {"key_code": "delete_forward", "modifiers": {"mandatory": ["left_control"]}},
    "to": [{"key_code": "delete_forward", "modifiers": ["left_alt"]}],
    "type": "basic"
}
0

You can import one of the predefined rules that are maintained by the community, or look at the JSON definition of those to see how it's done.

For example the "Map Ctrl+Backspace-Delete to Fn+Backward-Delete (suppr current character)" rule.

See https://ke-complex-modifications.pqrs.org/?q=Map%20Ctrl%2BBackspace-Delete

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .