Module: cwc.input

Lua library for managing input device from libinput.

Info:

  • Copyright: 2025
  • License: GPLv3
  • Originally authored by: Dwi Asmoro Bangun
    (Full contributors list available on our github project)

Static module functions

cwc.input.get () -> cwc_input[] Get all input device in the server.

Object properties

type integer Type of this device. Read only
name string The descriptive device name as advertised by the kernel and/or the hardware itself. Read only
sysname string System name of this device. Read only
output_name string The name of the output this device is mapped to, or nil if no output is set. Read only
id_vendor integer The vendor ID of this device. Read only
id_bustype integer The bus type ID of this device. Read only
id_product integer The product ID of this device. Read only
send_events_mode integer The send-event mode for this device.
left_handed boolean Set the left-handed configuration of the device.
sensitivity number Acceleration speed or as a sensitivity when using flat acceleration profile.
accel_profile integer Acceleration profile of this device.
natural_scroll boolean Natural scroll property of this device.
middle_emulation boolean Middle emulation property of this device.
rotation_angle integer The rotation of a device in degrees clockwise off the logical neutral position.
tap boolean Tap-to-click property of this device.
tap_drag boolean Tap-and-drag property of this device.
tap_drag_lock integer Tap-and-drag property of this device.
click_method integer The button click method of this device.
scroll_method integer The scroll method of this device.
dwt boolean Disable-while-typing feature state.

Signals

input::new Emitted when an input device is created.
input::destroy Emitted when an input device is about to be destroyed.


Static module functions

🔗 cwc.input.get () -> cwc_input[]
Get all input device in the server.

Returns:

    cwc_input[]

Object properties

🔗 type integer · read only
Type of this device.

Constraints:

Default value : provided by wlroots.
Negative allowed : false

See also:

cuteful.enum.device_type Input device type extracted from wlr-input-device.h (cuteful.enum) tables
🔗 name string · read only
The descriptive device name as advertised by the kernel and/or the hardware itself.

Constraints:

Default value : provided by libinput.
🔗 sysname string · read only
System name of this device.

Constraints:

Default value : provided by libinput.
🔗 output_name string · read only
The name of the output this device is mapped to, or nil if no output is set.

Constraints:

Default value : provided by libinput.
🔗 id_vendor integer · read only
The vendor ID of this device.

Constraints:

Default value : provided by libinput.
Negative allowed : false
🔗 id_bustype integer · read only
The bus type ID of this device.

Constraints:

Default value : provided by libinput.
Negative allowed : false
🔗 id_product integer · read only
The product ID of this device.

Constraints:

Default value : provided by libinput.
Negative allowed : false
🔗 send_events_mode integer
The send-event mode for this device.

Set it to SEND_EVENTS_DISABLE to disable the device.

Constraints:

Default value : hardware configuration dependent.
Negative allowed : false

See also:

cuteful.enum.libinput Pointer constant used for configuring pointer device from libinput.h Ref: https://wayland.freedesktop.org/libinput/doc/latest/api/group__config.html (cuteful.enum) tables
🔗 left_handed boolean
Set the left-handed configuration of the device.

Constraints:

Default value : false
Valid values : true or false.
🔗 sensitivity number
Acceleration speed or as a sensitivity when using flat acceleration profile.

Constraints:

Default value : 0.0
Minimum value : -1.0
Maximum value : 1.0
🔗 accel_profile integer
Acceleration profile of this device.

Constraints:

Default value : flat profile.
Negative allowed : false

See also:

cuteful.enum.libinput Pointer constant used for configuring pointer device from libinput.h Ref: https://wayland.freedesktop.org/libinput/doc/latest/api/group__config.html (cuteful.enum) tables
🔗 natural_scroll boolean
Natural scroll property of this device.

Constraints:

Default value : hardware configuration dependent.
Valid values : true or false.
🔗 middle_emulation boolean
Middle emulation property of this device.

Constraints:

Default value : hardware configuration dependent.
Valid values : true or false.
🔗 rotation_angle integer
The rotation of a device in degrees clockwise off the logical neutral position.

Constraints:

Default value : hardware configuration dependent.
Minimum value : 0
Maximum value : 360

See also:

cuteful.enum.libinput Pointer constant used for configuring pointer device from libinput.h Ref: https://wayland.freedesktop.org/libinput/doc/latest/api/group__config.html (cuteful.enum) tables
🔗 tap boolean
Tap-to-click property of this device.

Constraints:

Default value : hardware configuration dependent.
Valid values : true or false.
🔗 tap_drag boolean
Tap-and-drag property of this device.

Constraints:

Default value : hardware configuration dependent.
Valid values : true or false.
🔗 tap_drag_lock integer
Tap-and-drag property of this device.

Constraints:

Default value : hardware configuration dependent.
Negative allowed : false

See also:

cuteful.enum.libinput Pointer constant used for configuring pointer device from libinput.h Ref: https://wayland.freedesktop.org/libinput/doc/latest/api/group__config.html (cuteful.enum) tables
🔗 click_method integer
The button click method of this device.

Constraints:

Default value : hardware configuration dependent.
Negative allowed : false

See also:

cuteful.enum.libinput Pointer constant used for configuring pointer device from libinput.h Ref: https://wayland.freedesktop.org/libinput/doc/latest/api/group__config.html (cuteful.enum) tables
🔗 scroll_method integer
The scroll method of this device.

Constraints:

Default value : hardware configuration dependent.
Negative allowed : false

See also:

cuteful.enum.libinput Pointer constant used for configuring pointer device from libinput.h Ref: https://wayland.freedesktop.org/libinput/doc/latest/api/group__config.html (cuteful.enum) tables
🔗 dwt boolean
Disable-while-typing feature state.

Constraints:

Default value : hardware configuration dependent.
Valid values : true or false.

See also:

cuteful.enum.libinput Pointer constant used for configuring pointer device from libinput.h Ref: https://wayland.freedesktop.org/libinput/doc/latest/api/group__config.html (cuteful.enum) tables

Signals

🔗 input::new
Emitted when an input device is created.

Arguments:

Name Type(s) Description
device cwc_input The input device object.
🔗 input::destroy
Emitted when an input device is about to be destroyed.

Arguments:

Name Type(s) Description
device cwc_input The input device object.
generated by LDoc 1.5.0 based on AwesomeWM template