MacOS – How to map Ctrl + Delete to Fn + Opt + Delete with Karabiner-Elements

karabinerkeyboardmacos

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"
}

Best Answer

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.