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)

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 () 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_cursor_size (size) Set cursor size.
cwc.pointer.set_inactive_timeout (seconds) Set a timeout to automatically hide cursor, set timeout to 0 to disable.
cwc.pointer.set_edge_threshold (threshold) Set a threshold distance for applying common tile position.
cwc.pointer.set_edge_snapping_overlay_color (red, green, blue, alpha) Set color of the overlay when performing edge snapping.


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 ()
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_cursor_size (size)
Set cursor size.

Parameters:

Name Type(s) Description
size integer Cursor size
🔗 cwc.pointer.set_inactive_timeout (seconds)
Set a timeout to automatically hide cursor, set timeout to 0 to disable.

Parameters:

Name Type(s) Description
seconds integer Timeout in seconds
🔗 cwc.pointer.set_edge_threshold (threshold)
Set a threshold distance for applying common tile position.

Parameters:

Name Type(s) Description
threshold integer Threshold distance in pixel unit.
🔗 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.
generated by LDoc 1.5.0 based on AwesomeWM template