hammerspoon2-docs
    Preparing search index...

    Function makeKeyEvent

    • Create a keyboard event If mods is given, the event carries exactly those modifiers, whatever modifier keys are held when it's created. It is a single key event: to send a whole keystroke with modifiers to an application, including the modifier key presses some applications need to see, use hs.eventtap.keyStroke(mods, key, app). through the current keyboard layout (see hs.keycodes.map), or a numeric virtual key code Omit to keep the modifiers that are currently held.

      Parameters

      • key: string | number

        A key name or character (e.g. "a", "space", "return", "f1"), resolved

      • isDown: boolean

        true for key down, false for key up

      • Optionalmods: string[] | null

        An array of modifier names (e.g. ["cmd", "shift"]), as accepted by hs.eventtap.keyStroke().

      Returns HSEventTapEvent | null

      An HSEventTapEvent, or null if the key name is unknown