Module: mousegrabber
Set a callback to process all mouse events.
Info:
- Copyright: 2008-2009 Julien Danjou
-
Originally authored by: Julien Danjou <julien@danjou.info>
(Full contributors list available on our github project)
Static module functions
| mousegrabber.run (func, cursor) | Grab the mouse pointer and list motions, calling callback function at each motion. | |
| mousegrabber.stop () | Stop grabbing the mouse pointer. | |
| mousegrabber.isrunning () -> boolean | Check if mousegrabber is running. |
Static module functions
- 🔗 mousegrabber.run (func, cursor)
-
Grab the mouse pointer and list motions, calling callback function at each
motion. The callback function must return a boolean value: true to
continue grabbing, false to stop.
The function is called with one argument:
a table containing modifiers pointer coordinates.
The list of valid cursors is:
num\_glyphsarrowbased\_arrow\_downbased\_arrow\_upboatbogositybottom\_left\_cornerbottom\_right\_cornerbottom\_sidebottom\_teebox\_spiralcenter\_ptrcircleclockcoffee\_mugcrosscrosshaircross\_reversecursordiamond\_crossdotboxdotdouble\_arrowdraft\_largedraft\_smalldraped\_boxexchangefleurgobblergumbyhandhandhearticoniron\_crossleftbuttonleft\_ptrleft\_sideleft\_teell\_anglelr\_anglemanmiddlebuttonmousepencilpirateplusquestion\_arrowrightbuttonright\_ptrright\_sideright\_teertl\_logosailboatsb\_down\_arrowsb\_h\_double\_arrowsb\_left\_arrowsb\_right\_arrowsb\_up\_arrowsb\_v\_double\_arrowshuttlesizingspiderspraycanstartargettcrosstop\_left\_arrowtop\_left\_cornertop\_right\_cornertop\_sidetop\_teetrekul\_angleumbrellaur\_anglewatchxtermParameters:
Name Type(s) Description func function A callback function as described above. cursor string or nil The name of an X cursor to use while grabbing or nilto not change the cursor. - 🔗 mousegrabber.stop ()
- Stop grabbing the mouse pointer.
- 🔗 mousegrabber.isrunning () -> boolean
-
Check if mousegrabber is running.
Returns:
-
boolean
True if running, false otherwise.