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 |
Notes |
|
Source | extensions/eventtap/libeventtap_event.m line 1398 |
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. |
Notes |
|
Source | extensions/eventtap/libeventtap_event.m line 1531 |
Signature | hs.eventtap.event.types -> table |
---|---|
Type | Constant |
Description | A table containing event types to be used with |
Notes |
|
Source | extensions/eventtap/libeventtap_event.m line 1301 |
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/eventtap.lua line 87 |
Signature | hs.eventtap.event:copy() -> event |
---|---|
Type | Constructor |
Description | Duplicates an |
Parameters |
|
Returns |
|
Source | extensions/eventtap/libeventtap_event.m line 22 |
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 |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/libeventtap_event.m line 41 |
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/libeventtap_event.m line 60 |
Signature | hs.eventtap.event.newGesture(gestureType[, gestureValue]) -> event |
---|---|
Type | Constructor |
Description | Creates an gesture event. |
Parameters |
|
Returns |
|
Notes |
|
Examples | |
Source | extensions/eventtap/libeventtap_event.m line 84 |
Signature | hs.eventtap.event.newKeyEvent([mods], key, isdown) -> event |
---|---|
Type | Constructor |
Description | Creates a keyboard event |
Parameters |
|
Returns |
|
Notes |
hs.eventtap.event.newKeyEvent(hs.keycodes.map.shift, true):post()
hs.eventtap.event.newKeyEvent(hs.keycodes.map.alt, true):post()
hs.eventtap.event.newKeyEvent("a", true):post()
hs.eventtap.event.newKeyEvent("a", false):post()
hs.eventtap.event.newKeyEvent(hs.keycodes.map.alt, false):post()
hs.eventtap.event.newKeyEvent(hs.keycodes.map.shift, false):post()
hs.eventtap.event.newKeyEvent({"shift", "alt"}, "a", true):post()
hs.eventtap.event.newKeyEvent({"shift", "alt"}, "a", false):post()
|
Source | extensions/eventtap/libeventtap_event.m line 826 |
Signature | hs.eventtap.event.newMouseEvent(eventtype, point[, modifiers) -> event |
---|---|
Type | Constructor |
Description | Creates a new mouse event |
Parameters |
|
Returns |
|
Source | extensions/eventtap/eventtap.lua line 113 |
Signature | hs.eventtap.event.newScrollEvent(offsets, mods, unit) -> event |
---|---|
Type | Constructor |
Description | Creates a scroll wheel event |
Parameters |
|
Returns |
|
Source | extensions/eventtap/libeventtap_event.m line 1004 |
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/libeventtap_event.m line 904 |
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/libeventtap_event.m line 264 |
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/libeventtap_event.m line 767 |
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/libeventtap_event.m line 511 |
Signature | hs.eventtap.event:getFlags() -> table |
---|---|
Type | Method |
Description | Gets the keyboard modifiers of an event |
Parameters |
|
Returns |
|
Source | extensions/eventtap/libeventtap_event.m line 385 |
Signature | hs.eventtap.event:getKeyCode() -> keycode |
---|---|
Type | Method |
Description | Gets the raw keycode for the event |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/libeventtap_event.m line 541 |
Signature | hs.eventtap.event:getProperty(prop) -> number |
---|---|
Type | Method |
Description | Gets a property of the event |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/libeventtap_event.m line 735 |
Signature | hs.eventtap.event:getRawEventData() -> table |
---|---|
Type | Method |
Description | Returns raw data about the event |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/libeventtap_event.m line 458 |
Signature | hs.eventtap.event:getTouchDetails() -> table | nil |
---|---|
Type | Method |
Description | Returns a table containing more information about some touch related events. |
Parameters |
|
Returns |
|
Source | extensions/eventtap/libeventtap_event.m line 1239 |
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 |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/libeventtap_event.m line 1197 |
Signature | hs.eventtap.event:getType([nsSpecificType]) -> number |
---|---|
Type | Method |
Description | Gets the type of the event |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/libeventtap_event.m line 694 |
Signature | hs.eventtap.event:getUnicodeString() |
---|---|
Type | Method |
Description | Gets the single unicode character of an event |
Parameters |
|
Returns |
|
Source | extensions/eventtap/libeventtap_event.m line 580 |
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/libeventtap_event.m line 288 |
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/libeventtap_event.m line 652 |
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/libeventtap_event.m line 359 |
Signature | hs.eventtap.event:setFlags(table) -> event |
---|---|
Type | Method |
Description | Sets the keyboard modifiers of an event |
Parameters |
|
Returns |
|
Source | extensions/eventtap/libeventtap_event.m line 426 |
Signature | hs.eventtap.event:setKeyCode(keycode) |
---|---|
Type | Method |
Description | Sets the raw keycode for the event |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/libeventtap_event.m line 559 |
Signature | hs.eventtap.event:setProperty(prop, value) |
---|---|
Type | Method |
Description | Sets a property of the event |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/eventtap/libeventtap_event.m line 790 |
Signature | hs.eventtap.event:setType(type) -> event |
---|---|
Type | Method |
Description | Set the type for this event. |
Parameters |
|
Returns |
|
Source | extensions/eventtap/libeventtap_event.m line 341 |
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/libeventtap_event.m line 609 |
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/libeventtap_event.m line 1103 |
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/libeventtap_event.m line 314 |