hammerspoon2-docs
    Preparing search index...

    Variable mapConst

    map: Record<string, number>

    A mapping from key names to macOS virtual key codes, following the current keyboard layout.

    This is the same mapping hs.hotkey and hs.eventtap use to turn a key name into a key code. For the reverse direction, use names. The map is rebuilt automatically whenever the keyboard input source changes.

    Names include:

    • Characters: every character the current layout types with no modifiers held. Characters the layout doesn't type (e.g. 1 on AZERTY) map to their US-ANSI key position.
    • Punctuation words: minus, equal, leftbracket, rightbracket, backslash, semicolon, quote, comma, period, slash, grave. Each is the key that types that character in the current layout, so comma and , are always the same key.
    • Function keys: f1–f20
    • Navigation: home, end, pageup, pagedown, left, right, up, down
    • Numpad: pad0–pad9, pad., pad+, pad-, pad*, pad/, pad=, padenter, padclear
    • Modifiers: cmd, rightcmd, shift, ctrl, alt, rightshift, rightalt, rightctrl, fn, capslock
    • Control: return, tab, space, delete, forwarddelete, escape, help
    • Media: volup, voldown, mute
    • JIS: yen, underscore, pad,, eisu, kana