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)

Fields

cwc.kbd.bindmap cwc_kbindmap[] Get all cwc_kbindmap object in the server. Read only
cwc.kbd.default_member cwc_kbind[] Get keybind object in the default map. Read only
cwc.kbd.repeat_rate integer Keyboard repeat rate in hz.
cwc.kbd.repeat_delay integer Keyboard repeat delay in miliseconds.
cwc.kbd.xkb_rules string The rules file to use.
cwc.kbd.xkb_model string The keyboard model by which to interpret keycodes and LEDs.
cwc.kbd.xkb_layout string A comma separated list of layouts (languages) to include in the keymap.
cwc.kbd.xkb_variant string A comma separated list of variants.
cwc.kbd.xkb_options string A comma separated list of options.

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.


Fields

🔗 cwc.kbd.bindmap cwc_kbindmap[] · read only
Get all cwc_kbindmap object in the server.

See also:

default_member Get keybind object in the default map. fields
🔗 cwc.kbd.default_member cwc_kbind[] · read only
Get keybind object in the default map.

See also:

cwc_kbindmap:member Get list of all binding in the map. (cwc_kbindmap) object properties
🔗 cwc.kbd.repeat_rate integer
Keyboard repeat rate in hz.
🔗 cwc.kbd.repeat_delay integer
Keyboard repeat delay in miliseconds.
🔗 cwc.kbd.xkb_rules string
The rules file to use.

The rules file describes how to interpret the values of the model, layout, variant and options fields.

ref: xkbcommon reference

🔗 cwc.kbd.xkb_model string
The keyboard model by which to interpret keycodes and LEDs.

ref: xkbcommon reference

🔗 cwc.kbd.xkb_layout string
A comma separated list of layouts (languages) to include in the keymap.

ref: xkbcommon reference

🔗 cwc.kbd.xkb_variant string
A comma separated list of variants.

One per layout, which may modify or augment the respective layout in various ways.

Generally, should either be empty or have the same number of values as the number of layouts. You may use empty values as in "intl,,neo".

ref: xkbcommon reference

🔗 cwc.kbd.xkb_options string
A comma separated list of options.

Through which the user specifies non-layout related preferences, like which key combinations are used for switching layouts, or which key is the Compose key.

ref: xkbcommon reference

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
generated by LDoc 1.5.0 based on AwesomeWM template