Create, modify and inspect events for hs.eventtap
This module is based primarily on code from the previous incarnation of Mjolnir by Steven Degutis.
hs.eventtap.event.newGesture
uses an external library by Calf Trail Software, LLC.
Touch Copyright (C) 2010 Calf Trail Software, LLC
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Signature | hs.eventtap.event.properties -> table |
---|---|
Type | Constant |
Description | A table containing property types for use with `hs.eventtap.event:getProperty()` and `hs.eventtap.event:setProperty()`. The table supports forward (label to number) and reverse (number to label) lookups to increase its flexibility. |
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event.rawFlagMasks[] |
---|---|
Type | Constant |
Description | A table containing key-value pairs describing the raw modifier flags which can be manipulated with [hs.eventtap.event:rawFlags](#rawFlags). |
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event.types -> table |
---|---|
Type | Constant |
Description | A table containing event types to be used with `hs.eventtap.new(...)` and returned by `hs.eventtap.event:type()`. The table supports forward (label to number) and reverse (number to label) lookups to increase its flexibility. |
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event.newKeyEventSequence(modifiers, character) -> table |
---|---|
Type | Function |
Description | Generates a table containing the keydown and keyup events to generate the keystroke with the specified modifiers. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/init.lua |
Signature | hs.eventtap.event:copy() -> event |
---|---|
Type | Constructor |
Description | Duplicates an `hs.eventtap.event` event for further modification or injection |
Parameters |
|
Returns |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event.newEvent() -> event |
---|---|
Type | Constructor |
Description | Creates a blank event. You will need to set its type with [hs.eventtap.event:setType](#setType) |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event.newEventFromData(data) -> event |
---|---|
Type | Constructor |
Description | Creates an event from the data encoded in the string provided. |
Parameters |
|
Returns |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event.newGesture(gestureType[, gestureValue]) -> event |
---|---|
Type | Constructor |
Description | Creates an gesture event. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event.newKeyEvent([mods], key, isdown) -> event |
---|---|
Type | Constructor |
Description | Creates a keyboard event |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event.newMouseEvent(eventtype, point[, modifiers) -> event |
---|---|
Type | Constructor |
Description | Creates a new mouse event |
Parameters |
|
Returns |
|
Source | extensions/eventtap/init.lua |
Signature | hs.eventtap.event.newScrollEvent(offsets, mods, unit) -> event |
---|---|
Type | Constructor |
Description | Creates a scroll wheel event |
Parameters |
|
Returns |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event.newSystemKeyEvent(key, isdown) -> event |
---|---|
Type | Constructor |
Description | Creates a keyboard event for special keys (e.g. media playback) |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:asData() -> string |
---|---|
Type | Method |
Description | Returns a string containing binary data representing the event. This can be used to record events for later use. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:getButtonState(button) -> bool |
---|---|
Type | Method |
Description | Gets the state of a mouse button in the event |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:getCharacters([clean]) -> string or nil |
---|---|
Type | Method |
Description | Returns the Unicode character, if any, represented by a keyDown or keyUp event. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:getFlags() -> table |
---|---|
Type | Method |
Description | Gets the keyboard modifiers of an event |
Parameters |
|
Returns |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:getKeyCode() -> keycode |
---|---|
Type | Method |
Description | Gets the raw keycode for the event |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:getProperty(prop) -> number |
---|---|
Type | Method |
Description | Gets a property of the event |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:getRawEventData() -> table |
---|---|
Type | Method |
Description | Returns raw data about the event |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:getTouchDetails() -> table | nil |
---|---|
Type | Method |
Description | Returns a table contining more information about some touch related events. |
Parameters |
|
Returns |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:getTouches() -> table | nil |
---|---|
Type | Method |
Description | Returns a table of details containing information about touches on the trackpad associated with this event if the event is of the type `hs.eventtap.event.types.gesture`. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:getType([nsSpecificType]) -> number |
---|---|
Type | Method |
Description | Gets the type of the event |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:getUnicodeString() |
---|---|
Type | Method |
Description | Gets the single unicode character of an event |
Parameters |
|
Returns |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:location([pointTable]) -> event | table |
---|---|
Type | Method |
Description | Get or set the current mouse pointer location as defined for the event. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:post([app]) |
---|---|
Type | Method |
Description | Posts the event to the OS - i.e. emits the keyboard/mouse input defined by the event |
Parameters |
|
Returns |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:rawFlags([flags]) -> event | integer |
---|---|
Type | Method |
Description | Experimental method to get or set the modifier flags for an event directly. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:setFlags(table) -> event |
---|---|
Type | Method |
Description | Sets the keyboard modifiers of an event |
Parameters |
|
Returns |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:setKeyCode(keycode) |
---|---|
Type | Method |
Description | Sets the raw keycode for the event |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:setProperty(prop, value) |
---|---|
Type | Method |
Description | Sets a property of the event |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:setType(type) -> event |
---|---|
Type | Method |
Description | Set the type for this event. |
Parameters |
|
Returns |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:setUnicodeString(string) |
---|---|
Type | Method |
Description | Sets a unicode string as the output of the event |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:systemKey() -> table |
---|---|
Type | Method |
Description | Returns the special key and its state if the event is a NSSystemDefined event of subtype AUX_CONTROL_BUTTONS (special-key pressed) |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |
Signature | hs.eventtap.event:timestamp([absolutetime]) -> event | integer |
---|---|
Type | Method |
Description | Get or set the timestamp of the event. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/event.m |