0

I'm using a Mac Mini running Catalina with a Logitech K270 keyboard, with Karabiner 12.10.0. I've done some simple key changes, I work with latex, where the backslash symbol is written a lot, I get " \ " backslash with AltGr ("right_option") + < > ("non_us_backslash") keys, I prefer use the combo: AltGr ("right_option") + \ ("grave_accent_and_tilde"). I have in the karabiner.json:

"rules": [
                {
                    "description": "Barra Invertida",
                    "manipulators": [
                        {
                            "from": {
                                "key_code": "non_us_backslash",
                                "modifiers": "right_option"
                                }
                            },
                            "to": [
                                {
                                    "key_code": "grave_accent_and_tilde",
                                    "modifiers": "right_option"
                                }
                            ],
                            "type": "basic"
                        }
                    ]
                }
            ]
        },

But I can't get the backslash symbol.

Any suggestions? Can it be remapped to a single key?

3
  • 1
    Parts of your post make no sense, like where you have the backslash graphic described as grave and tilde. What language keyboard are you using? Dec 16, 2020 at 2:32
  • Thanks @TomGewecke! The Logitech K270 keyboard is in spanish language, the key with backslash symbol is in the left upper corner, using Karabiner Event-Viewer, when I press these key, the name appears as "grave_and_accent_tilde", then I have used these names of keys. ;-)
    – Gustux
    Dec 17, 2020 at 3:28
  • I would create a new keyboard layout in this specific case using ukulele.
    – William
    Oct 21, 2021 at 23:54

1 Answer 1

0

First, if you use modifiers in a "from": context they need either be "mandatory" (as probable in your case) or "optional" (if allowed but not necessary). Your "from": line therefore must be expanded to:

"from": { "key_code": "non_us_backslash",
          "modifiers": { "mandatory": ["right_option"] }
        }

Further, I (can only) suspect that actually you want to press
right_option + grave_accent_and_tilde in order to print a \ char.

In this case right_option + non_us_backslash is actually NOT your "from": but your goal –
you want to press a "fresh" combo that tells Karabiner to press an "unwanted" one for you.

Your code (in part) should read:

"from": {
    "key_code": "grave_accent_and_tilde",
    "modifiers": { "mandatory": ["right_option"]
                                }
        },
  "to": [
        {
          "key_code": "non_us_backslash",
          "modifiers": "right_option"
                                }

Now, if you want a single-key-combination your "from": could be for example:

"from": { "key_code": "grave_accent_and_tilde" }   -- use any key you like!
    "to": [
        {
          "key_code": "non_us_backslash",
          "modifiers": "right_option"
                                }

You must log in to answer this question.

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