Tap into input events (mouse, keyboard, trackpad) for observation and possibly overriding them.
It also provides convenience wrappers for sending mouse and keyboard events. If you need to construct finely controlled mouse/keyboard events, see hs.eventtap.event
.
This module is based primarily on code from the previous incarnation of Mjolnir by Steven Degutis.
Signature | hs.eventtap.checkKeyboardModifiers([raw]) -> table |
---|---|
Type | Function |
Description | Returns a table containing the current key modifiers being pressed or in effect at this instant for the keyboard most recently used. |
Parameters |
|
Returns |
and optionally * _raw - a numeric representation of the numeric representation of all of the keyboard/modifier flags. |
Notes |
|
Source | extensions/eventtap/libeventtap.m line 276 |
Signature | hs.eventtap.checkMouseButtons() -> table |
---|---|
Type | Function |
Description | Returns a table containing the current mouse buttons being pressed at this instant. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/libeventtap.m line 353 |
Signature | hs.eventtap.doubleClickInterval() -> number |
---|---|
Type | Function |
Description | Returns the system-wide setting for the delay between two clicks, to register a double click event |
Parameters |
|
Returns |
|
Source | extensions/eventtap/libeventtap.m line 422 |
Signature | hs.eventtap.isSecureInputEnabled() -> boolean |
---|---|
Type | Function |
Description | Checks if macOS is preventing keyboard events from being sent to event taps |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/libeventtap.m line 330 |
Signature | hs.eventtap.keyRepeatDelay() -> number |
---|---|
Type | Function |
Description | Returns the system-wide setting for the delay before keyboard repeat events begin |
Parameters |
|
Returns |
|
Source | extensions/eventtap/libeventtap.m line 408 |
Signature | hs.eventtap.keyRepeatInterval() -> number |
---|---|
Type | Function |
Description | Returns the system-wide setting for the interval between repeated keyboard events |
Parameters |
|
Returns |
|
Source | extensions/eventtap/libeventtap.m line 394 |
Signature | hs.eventtap.keyStroke(modifiers, character[, delay, application]) |
---|---|
Type | Function |
Description | Generates and emits a single keystroke event pair for the supplied keyboard modifiers and character |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/eventtap.lua line 242 |
Signature | hs.eventtap.keyStrokes(text[, application]) |
---|---|
Type | Function |
Description | Generates and emits keystroke events for the supplied text |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/libeventtap.m line 81 |
Signature | hs.eventtap.leftClick(point[, delay]) |
---|---|
Type | Function |
Description | Generates a left mouse click event at the specified point |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/eventtap.lua line 147 |
Signature | hs.eventtap.middleClick(point[, delay]) |
---|---|
Type | Function |
Description | Generates a middle mouse click event at the specified point |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/eventtap.lua line 225 |
Signature | hs.eventtap.otherClick(point[, delay][, button]) |
---|---|
Type | Function |
Description | Generates an "other" mouse click event at the specified point |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/eventtap.lua line 193 |
Signature | hs.eventtap.rightClick(point[, delay]) |
---|---|
Type | Function |
Description | Generates a right mouse click event at the specified point |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/eventtap.lua line 170 |
Signature | hs.eventtap.scrollWheel(offsets, modifiers, unit) -> event |
---|---|
Type | Function |
Description | Generates and emits a scroll wheel event |
Parameters |
|
Returns |
|
Source | extensions/eventtap/eventtap.lua line 281 |
Signature | hs.eventtap.new(types, fn) -> eventtap |
---|---|
Type | Constructor |
Description | Create a new event tap object |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/libeventtap.m line 146 |
Signature | hs.eventtap:isEnabled() -> bool |
---|---|
Type | Method |
Description | Determine whether or not an event tap object is enabled. |
Parameters |
|
Returns |
|
Source | extensions/eventtap/libeventtap.m line 261 |
Signature | hs.eventtap:start() |
---|---|
Type | Method |
Description | Starts an event tap |
Parameters |
|
Returns |
|
Source | extensions/eventtap/libeventtap.m line 196 |
Signature | hs.eventtap:stop() |
---|---|
Type | Method |
Description | Stops an event tap |
Parameters |
|
Returns |
|
Source | extensions/eventtap/libeventtap.m line 236 |