Press and release a system key, such as a media, volume or brightness key.
A 5 ms pause is inserted between the key-down and key-up events. See
makeSystemKeyEvent() for details of how these keys behave.
Be careful with POWER and EJECT, which can show a shutdown prompt or eject media.
Parameters
key: string
A system key name from hs.eventtap.systemKeys (e.g. "PLAY", "NEXT"), case-insensitive
Press and release a system key, such as a media, volume or brightness key. A 5 ms pause is inserted between the key-down and key-up events. See
makeSystemKeyEvent()for details of how these keys behave. Be careful withPOWERandEJECT, which can show a shutdown prompt or eject media.