I would like to map out the key combination Opt+- to shift focus to another monitor using yabai using skhd. Something like this:

alt - MINUS : yabai -m display --focus recent

However, I have not been able to figure out what to put in for "MINUS". I know that skhd can take keycodes as arguments. However, I'm not sure how to get the keycode for -. I used the Key Codes application and put in the values I got there but none seem to work.

Key Down
    Characters: -
    Unicode:        45 / 0x2d
    Keys:       -
    Key Code:   27 / 0x1b
    Modifiers:  256 / 0x100 
  • I use AZERTY (French) keyboard the minus key outputs 0x18
    – tama
    Mar 7, 2022 at 14:12

1 Answer 1


You can use the skhd --observe command to find the keycode to use.

Use Ctrl+C to terminate the skhd --observe command.

P.S. If the keycode has letters, please use capital letters.

You must log in to answer this question.

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