Create, modify and inspect events for hs.eventtap.
This module is based primarily on code from the previous incarnation of Mjolnir.
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 1404 |
| 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 1537 |
| 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 1307 |
| 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 832 |
| 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 1010 |
| 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 910 |
| 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 270 |
| 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 773 |
| 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 517 |
| 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 391 |
| 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 547 |
| 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 741 |
| 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 464 |
| 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 1245 |
| 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 1203 |
| 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 700 |
| 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 586 |
| 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 294 |
| 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 658 |
| 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 365 |
| 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 432 |
| 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 565 |
| 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 796 |
| 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 347 |
| 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 615 |
| 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 1109 |
| 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 320 |