Module: cwc.kbd
Low-level API to manage keyboard behavior
Info:
- Copyright: 2024
- License: GPLv3
-
Originally authored by: Dwi Asmoro Bangun
(Full contributors list available on our github project)
Static module functions
cwc.kbd.bind (modifier, keyname, on_press, on_release, data) | Register a keyboard binding to the default map. | |
cwc.kbd.clear (common_key) | Clear all keyboard binding in the default map. | |
cwc.kbd.create_bindmap () -> cwc_kbindmap | Create a new keybind map. | |
cwc.kbd.get_bindmap () -> cwc_kbindmap[] | Get all cwc_kbindmap object in the server. | |
cwc.kbd.get_default_member () -> cwc_kbind[] | Get keybind object in the default map. |
Config functions
cwc.kbd.set_repeat_rate (rate) | Set keyboard repeat rate. | |
cwc.kbd.set_repeat_delay (delay) | Set keyboard repeat delay. |
Static module functions
- 🔗 cwc.kbd.bind (modifier, keyname, on_press, on_release, data)
-
Register a keyboard binding to the default map.
Keybinding registered in this map is always active and cannot be deactivated.
Parameters:
Name Type(s) Description modifier table or number Table of modifier or modifier bitfield keyname string Keyname from xkbcommon-keysyms.h
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 exclusive Optional string Allow keybind to be executed even in lockscreen and shortcut inhibit repeated Optional string Repeat keybind when hold (only on_press will be executed) See also:
cuteful.enum.modifier Keyboard modifier constant mapped from wlr_keyboard.h
(cuteful.enum)tables cwc.pointer.bind Register a mouse binding. (cwc.pointer) static module functions cwc_kbindmap:bind Register a keyboard binding. (cwc_kbindmap) object methods - 🔗 cwc.kbd.clear (common_key)
-
Clear all keyboard binding in the default map.
Parameters:
Name Type(s) Description Default value common_key Optional boolean Also clear common key (chvt key) false
- 🔗 cwc.kbd.create_bindmap () -> cwc_kbindmap
-
Create a new keybind map.
Returns:
-
cwc_kbindmap
- 🔗 cwc.kbd.get_bindmap () -> cwc_kbindmap[]
-
Get all cwc_kbindmap object in the server.
Returns:
-
cwc_kbindmap[]
See also:
get_default_member Get keybind object in the default map. static module functions - 🔗 cwc.kbd.get_default_member () -> cwc_kbind[]
-
Get keybind object in the default map.
Returns:
-
cwc_kbind[]
See also:
cwc_kbindmap:member Get list of all binding in the map. (cwc_kbindmap) object properties