XkbGetBounceKeysDelay(3)
π XkbGetBounceKeysDelay β the girlies' guide π
okay so this one lives in the XKB FUNCTIONS section of the libX11 manual, and it's genuinely such a useful little guy. sit down, hydrate, let's get into it β¨
πΈ NAME πΈ
XkbGetBounceKeysDelay β it asks your keyboard device "hey bestie, what's your current BounceKeys delay?" and reports back. that's the whole job. iconique.
π SYNOPSIS π
Bool XkbGetBounceKeysDelay (Display *display, unsigned int device_spec,
unsigned int *delay_rtrn);
π¦ ARGUMENTS π¦
displayβ the connection to your X server. your link to the mothership fr.device_specβ the device ID, orXkbUseCoreKbdif you want the core keyboard (iykyk).delay_rtrnβ gets backfilled with the bounce keys delay, in ms. she's an output param, she's giving β¨pointerβ¨.
π DESCRIPTION π
so the server can generate XkbAccessXNotify events for some of the global keyboard controls. the detail field tells you exactly 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.
ngl that warning one is giving "heads up bestie, something's about to change" energy.
the keycode field reports the keycode of the key the event happened for. if the action is related to SlowKeys, the slowKeysDelay field contains the current SlowKeys acceptance delay. if the action is related to BounceKeys, the debounceDelay field contains the current BounceKeys debounce delay. no cap.
Selecting for AccessX Events
to receive XkbAccessXNotify events under all possible conditions, use XkbSelectEvents and pass XkbAccesXNotifyMask in both bits_to_change and values_for_bits. (yes, that spelling β XkbAccesXNotifyMask β is exactly how the original says it, don't come for me π«Ά)
to receive XkbStateNotify events only under certain conditions, use XkbSelectEventDetails with XkbAccessXNotify as the event_type and specify the state changes you want in bits_to_change and values_for_bits, using 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
the actual bounce keys lore π
some users may accidentally "bounce" on a key when they release it. they press it once, then accidentally press it again after they release it. the BounceKeys control temporarily disables a key after it has been pressed, effectively "debouncing" the keyboard. the period of time the key is disabled after it is released is known as the BounceKeys delay. 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 (see STRUCTURES). she's keeping everyone in the loop, so considerate π
XkbGetBounceKeysDelay requests the attributes of the BounceKeys control from the server, waits for a reply, and backfills delay_rtrn with the BounceKeys delay attribute. XkbGetBounceKeysDelay returns True if successful; if a compatible version of the Xkb extension is not available in the server XkbGetSlowKeysDelay returns False.
β οΈ okay yes, that last sentence saysXkbGetSlowKeysDelayand notXkbGetBounceKeysDelay. that is exactly what the original page says, so I'm leaving it alone. do not @ me, I do not make the rules π
π RETURN VALUES π
Trueβ TheXkbGetBounceKeysDelayfunction returnsTruewhen it successfully requests the attributes of the BounceKeys control from the server, waits for a reply, and backfillsdelay_rtrnwith the BounceKeys delay attribute. slay.Falseβ TheXkbGetBounceKeysDelayfunction returnsFalseif a compatible version of the Xkb extension is not available in the server. tragic, honestly π
π STRUCTURES π
the structure for the XkbAccessXNotify event type is as follows:
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;
look at her. immaculate. π
π SEE ALSO π
and that's the tea, bestie π«Ά this page is from X Version 11, libX11 1.8.4 β shoutout to the libX11 girlies for keeping the keyboard vibes immaculate. go forth and debounce responsibly β¨ππΈ
π¦ 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