On this page
hs.mouse
Inspect/manipulate the position of the mouse pointer
This module is based primarily on code from the previous incarnation of Mjolnir by Steven Degutis.
This module uses ManyMouse by Ryan C. Gordon.
MANYMOUSE LICENSE:
Copyright (c) 2005-2012 Ryan C. Gordon and others.
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
This notice may not be removed or altered from any source distribution.
Ryan C. Gordon icculus@icculus.org
API Overview
- Functions - API calls offered directly by the extension
API Documentation
Functions
absolutePosition
Signature | hs.mouse.absolutePosition([point]) -> point |
---|---|
Type | Function |
Description | Get or set the absolute co-ordinates of the mouse pointer |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/mouse/libmouse.m line 202 |
count
Signature | hs.mouse.count([includeInternal]) -> number |
---|---|
Type | Function |
Description | Gets the total number of mice connected to your system. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/mouse/libmouse.m line 154 |
currentCursorType
Signature | hs.mouse.currentCursorType() -> string |
---|---|
Type | Function |
Description | Gets the identifier of the current mouse cursor type. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/mouse/libmouse.m line 274 |
getButtons
Signature | hs.mouse.getButtons() -> table |
---|---|
Type | Function |
Description | Returns a table containing the current mouse buttons being pressed at this instant. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/mouse/mouse.lua line 154 |
getCurrentScreen
Signature | hs.mouse.getCurrentScreen() -> screen or nil |
---|---|
Type | Function |
Description | Gets the screen the mouse pointer is on |
Parameters |
|
Returns |
|
Source | extensions/mouse/mouse.lua line 140 |
getRelativePosition
Signature | hs.mouse.getRelativePosition() -> point or nil |
---|---|
Type | Function |
Description | Gets the co-ordinates of the mouse pointer, relative to the screen it is on |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/mouse/mouse.lua line 84 |
names
Signature | hs.mouse.names() -> table |
---|---|
Type | Function |
Description | Gets the names of any mice connected to the system. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/mouse/libmouse.m line 182 |
scrollDirection
Signature | hs.mouse.scrollDirection() -> string |
---|---|
Type | Function |
Description | Gets the system-wide direction of scrolling |
Parameters |
|
Returns |
|
Source | extensions/mouse/libmouse.m line 257 |
setRelativePosition
Signature | hs.mouse.setRelativePosition(point[, screen]) |
---|---|
Type | Function |
Description | Sets the co-ordinates of the mouse pointer, relative to a screen |
Parameters |
|
Returns |
|
Source | extensions/mouse/mouse.lua line 112 |
trackingSpeed
Signature | hs.mouse.trackingSpeed([speed]) -> number |
---|---|
Type | Function |
Description | Gets/Sets the current system mouse tracking speed setting |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/mouse/libmouse.m line 227 |
© 2014–2017 Hammerspoon contributors
Licensed under the MIT License.
https://www.hammerspoon.org/docs/hs.mouse.html