0

For a MacOS app I use (Notion), I wish to toggle the sidebar via the app-designated keyboard shortcut + \. This shortcut works fine on US English keyboard layouts, but not on the Swedish keyboard I'm using.

The key that is reserved for \ (next to Return) on US English keyboards, instead types ' on Swedish keyboards.

I presumed that Karabiner-Elements could potentially solve this problem by remapping the shortcuts.

However, when inspecting Karabiner-EventViewer, it shows that pressing ' appears as \ in the event log:

type:key_down        code:49         name:backslash       misc:
type:key_up          code:49         name:backslash       misc:

If Karabiner-Elements interprets the key ' as \, then it would seem I'm out of luck to remap these keys, since I'm assuming the script would essentially build on being able to discern between these two keys.

I'm not experienced with Karabiner, but below is roughly how I intended to solve the problem using a Complex Modification in karabiner.json. Please note that I have copied bits from other sources and adapted them – I don't know if the structure and options are correct as they are untested.

As you can see, it probably doesn't make sense to rebind from "key_code":"backslash" to "key_code":"backslash".

{
   "manipulators":[
      {
         "description":"Notion: Remap CMD + ' to CMD + Backslash",
         "from":{
            "key_code":"backslash",
            "modifiers":{
               "mandatory":[
                  "right_command"
               ]
            }
         },
         "to":[
            {
               "key_code":"backslash",
               "modifiers":[
                  "right_command"
               ]
            }
         ],
         "conditions":[
            {
               "type":"frontmost_application_if",
               "bundle_identifiers":[
                  "^notion.id"
               ]
            }
         ],
         "type":"basic"
      }
   ]
}

How can I solve this problem? Can Karabiner-elements be made to accurately interpret ' in its EventViewing capacity, or can I use some key designation in the JSON specific to '? Or use some other solution entirely?

7
  • Is that command in a Menu on Notion [never used that app]. If it is, what key command does it say it ought to be?
    – Tetsujin
    Jul 9, 2020 at 8:36
  • @Tetsujin Thanks for asking. Unfortunately not – if there was, I could use e.g. System Key Command Editor or BetterTouchTool to bind a keyboard shortcut to trigger the Menu option.
    – P A N
    Jul 9, 2020 at 8:39
  • 1
    If there was, you could use the system key command editor. If there isn't, then yes, you'll either need 3rd party or see if cmd/opt/shift/7 will work - Swedish has \ on opt/shift/7
    – Tetsujin
    Jul 9, 2020 at 8:41
  • Thanks for the suggestion. I tried binding to "key_code":"7", "modifiers":["right_command", "right_option", "right_shift"], but did not work.
    – P A N
    Jul 9, 2020 at 9:07
  • Maybe you can specify the raw value for key_code, like "key_code": 49, ...? Jul 15, 2020 at 4:01

1 Answer 1

-1

In order to toggle the sidebar via the app-designated keyboard shortcut =>

– open System Preferences > Keyboard > Shortcuts > Launchpad & Dock

– activate "Toggle Dock: on/off"

– click on the right-most shortcut (once)

– in-put whatever shortcut you like

– try this shortcut instantly & close System Preferences

I am translating (roughly) from a German "Systemeinstellungen" so the wording inside SysPrefs may differ … Good luck!

You must log in to answer this question.

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