XkbSetBounceKeysDelay(3)
β¨ 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, orXkbUseCoreKbdif you just want the core keyboarddelayβ 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 wantedXkbAXN_SKAcceptMaskβ(1<<1)β Slow key accept notification wantedXkbAXN_SKRejectMaskβ(1<<2)β Slow key reject notification wantedXkbAXN_SKReleaseMaskβ(1<<3)β Slow key release notification wantedXkbAXN_BKAcceptMaskβ(1<<4)β Bounce key accept notification wantedXkbAXN_BKRejectMaskβ(1<<5)β Bounce key reject notification wantedXkbAXN_AXKWarningMaskβ(1<<6)β AccessX warning notification wantedXkbAllAccessXEventsMaskβ(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β TheXkbSetBounceKeysDelayfunction returnsTruewhen it sends a request to configure the BounceKeys control to the server.Falseβ TheXkbSetBounceKeysDelayfunction returnsFalseif 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
- debian bookworm: libx11-doc 2:1.8.4-2+deb12u2
- Copyright (c) 1999, Oracle and/or its affiliates
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms