Module: cwc.pointer
Low-level API to manage pointer and pointer device
Info:
- Copyright: 2024
- License: GPLv3
-
Originally authored by: Dwi Asmoro Bangun
(Full contributors list available on our github project)
Fields
cwc.pointer.cursor_size | integer | Set cursor size. | |
cwc.pointer.inactive_timeout | integer | Set a timeout in seconds to automatically hide cursor, set timeout to 0 to disable. | |
cwc.pointer.edge_threshold | integer | Set a threshold distance for applying common tile position in pixel unit. |
Static module functions
cwc.pointer.bind (modifier, mouse_btn, on_press, on_release, data) | Register a mouse binding. | |
cwc.pointer.clear () | Clear all mouse binding. | |
cwc.pointer.get_position () -> table | Get main seat pointer position. | |
cwc.pointer.set_position (x, y) | Set main seat pointer position. | |
cwc.pointer.move_interactive () | Start interactive move for client under the cursor. | |
cwc.pointer.resize_interactive () | Start interactive resize for client under the cursor. | |
cwc.pointer.stop_interactive () | Stop interactive mode. |
Config functions
cwc.pointer.set_edge_snapping_overlay_color (red, green, blue, alpha) | Set color of the overlay when performing edge snapping. |
Fields
- 🔗 cwc.pointer.cursor_size integer
- Set cursor size.
- 🔗 cwc.pointer.inactive_timeout integer
- Set a timeout in seconds to automatically hide cursor, set timeout to 0 to disable.
- 🔗 cwc.pointer.edge_threshold integer
- Set a threshold distance for applying common tile position in pixel unit.
Static module functions
- 🔗 cwc.pointer.bind (modifier, mouse_btn, on_press, on_release, data)
-
Register a mouse binding.
Parameters:
Name Type(s) Description modifier table or number Table of modifier or modifier bitfield mouse_btn number Button from linux input-event-codes on_press func Function to execute when pressed on_release Optional func Function to execute when released data Optional table Additional data group Optional string Keybinding group description Optional string Keybinding description See also:
cuteful.enum.modifier Keyboard modifier constant mapped from wlr_keyboard.h
(cuteful.enum)tables cuteful.enum.mouse_btn Extracted from Linux input-event-codes.h
(cuteful.enum)tables cwc.kbd.bind Register a keyboard binding to the default map. (cwc.kbd) static module functions - 🔗 cwc.pointer.clear ()
- Clear all mouse binding.
- 🔗 cwc.pointer.get_position () -> table
-
Get main seat pointer position.
Returns:
-
table
Pointer coords with structure {x,y}
- 🔗 cwc.pointer.set_position (x, y)
-
Set main seat pointer position.
Parameters:
Name Type(s) Description x integer y integer - 🔗 cwc.pointer.move_interactive ()
- Start interactive move for client under the cursor.
- 🔗 cwc.pointer.resize_interactive ()
- Start interactive resize for client under the cursor.
- 🔗 cwc.pointer.stop_interactive ()
- Stop interactive mode.
Config functions
- 🔗 cwc.pointer.set_edge_snapping_overlay_color (red, green, blue, alpha)
-
Set color of the overlay when performing edge snapping.
gears.color is not gonna work because the overlay isn't a cairo surface.
Parameters:
Name Type(s) Description red number Value of red. green number Value of green. blue number Value of blue. alpha number Alpha value.