XkbSetBounceKeysDelay(3)

πŸ“¦
version 1.8.4 Β· 2 versions
, in debian bookworm

✨ XkbSetBounceKeysDelay πŸ’…

okay bestie, welcome to the XkbSetBounceKeysDelay(3) page β€” yeah it's a section 3 man page from the XKB FUNCTIONS fam, and it's about making your keyboard stop double-firing on you when your fingers are being extra. sit down, grab a boba, we're doing this πŸ§‹


🌸 NAME 🌸

XkbSetBounceKeysDelay β€” Sets the BounceKeys delay for a keyboard device


✨ SYNOPSIS ✨

Bool XkbSetBounceKeysDelay (Display *display, unsigned int device_spec,
       unsigned int *delay);

πŸŽ€ ARGUMENTS πŸŽ€

  • display β€” the connection to the X server, obviously πŸ’
  • device_spec β€” the device ID, or XkbUseCoreKbd if you just want the core keyboard
  • delay β€” this one gets backfilled with the bounce keys delay, in ms ⏱️

πŸ¦‹ DESCRIPTION πŸ¦‹

so the server can generate XkbAccessXNotify events for some of the global keyboard controls. the detail field is the one that spills the tea about what AccessX event just happened, and it can be any of the values in Table 1 πŸ‘‡

πŸ’– Table 1 AccessXNotify Events πŸ’–

  • XkbAXN_SKPress β€” A key was pressed when SlowKeys was enabled.
  • XkbAXN_SKAccept β€” A key was accepted (held longer than the SlowKeys delay).
  • XkbAXN_SKRelease β€” An accepted SlowKeys key was released.
  • XkbAXN_SKReject β€” A key was rejected (released before the SlowKeys delay expired).
  • XkbAXN_BKAccept β€” A key was accepted by BounceKeys.
  • XkbAXN_BKReject β€” A key was rejected (pressed before the BounceKeys delay expired).
  • XkbAXN_AXKWarning β€” AccessXKeys is about to turn on/off StickyKeys or BounceKeys.

the keycode field reports the keycode of the key the event happened for, iykyk. and if the action is about SlowKeys, the slowKeysDelay field is holding the current SlowKeys acceptance delay. if it's about BounceKeys instead, then it's the debounceDelay field carrying the current BounceKeys debounce delay πŸ’«

🌈 Selecting for AccessX Events 🌈

to receive XkbAccessXNotify events under literally all possible conditions, use XkbSelectEvents and pass XkbAccesXNotifyMask in both bits_to_change and values_for_bits. (yes bestie, that's spelled exactly like that in the source, we don't fix it, we respect it πŸ’€)

to receive XkbStateNotify events only under certain conditions, use XkbSelectEventDetails with XkbAccessXNotify as the event_type, and specify the desired state changes in bits_to_change and values_for_bits using the mask bits from Table 2 πŸ‘‡

πŸ’… Table 2 AccessXNotify Event Details πŸ’…

  • XkbAXN_SKPressMask β€” (1<<0) β€” Slow key press notification wanted
  • XkbAXN_SKAcceptMask β€” (1<<1) β€” Slow key accept notification wanted
  • XkbAXN_SKRejectMask β€” (1<<2) β€” Slow key reject notification wanted
  • XkbAXN_SKReleaseMask β€” (1<<3) β€” Slow key release notification wanted
  • XkbAXN_BKAcceptMask β€” (1<<4) β€” Bounce key accept notification wanted
  • XkbAXN_BKRejectMask β€” (1<<5) β€” Bounce key reject notification wanted
  • XkbAXN_AXKWarningMask β€” (1<<6) β€” AccessX warning notification wanted
  • XkbAllAccessXEventsMask β€” (0x7f) β€” All AccessX features notifications wanted

okay so some users may accidentally "bounce" on a key when they release it β€” they press it once, then oops, press it again right after letting go. main character finger energy, honestly. the BounceKeys control temporarily disables a key after it's been pressed, which effectively "debounces" the keyboard. and the period of time the key stays disabled after it's released? that's the BounceKeys delay, periodt. BounceKeys is a boolean control.

when the BounceKeys control is active, the server reports acceptance or rejection of any key to interested clients by sending an appropriate AccessXNotify event πŸ“¬

XkbSetBounceKeysDelay sends a request to configure the BounceKeys control to the server. it does not wait for a reply and normally returns True. but β€” and listen β€” specifying a value of zero for the delay parameter causes XkbSetBounceKeysDelay to generate a BadValue protocol error. so like, don't. 🚫

if a compatible version of the Xkb extension is not available in the server, XkbSetBounceKeysDelay returns False. sad but true 😭


🫢 RETURN VALUES 🫢

  • True β€” The XkbSetBounceKeysDelay function returns True when it sends a request to configure the BounceKeys control to the server.
  • False β€” The XkbSetBounceKeysDelay function returns False if a compatible version of the Xkb extension is not available in the server.

πŸ‘‘ STRUCTURES πŸ‘‘

the structure for the XkbAccessXNotify event type is giving:

typedef struct {
    int            type;           /* Xkb extension base event code */
    unsigned long  serial;         /* X server serial number for event */
    Bool           send_event;     /* True => synthetically generated */
    Display *      display;        /* server connection where event generated */
    Time           time;           /* server time when event generated */
    int            xkb_type;       /* XkbAccessXNotify */
    int            device;         /* Xkb device ID, will not be XkbUseCoreKbd */
    int            detail;         /* XkbAXN_* */
    KeyCode        keycode;        /* key of event */
    int            slowKeysDelay;  /* current SlowKeys delay */
    int            debounceDelay;  /* current debounce delay */
} XkbAccessXNotifyEvent;

πŸ’€ DIAGNOSTICS πŸ’€

  • BadValue β€” An argument is out of range

and that's the whole page bestie, no cap πŸŽ€ it's from X Version 11, libX11 1.8.4, and you can find it filed under XkbSetBounceKeysDelay(3). go forth and debounce your keyboard, you absolute icon πŸ’–βœ¨

πŸ“¦ where this page comes from