Table of Contents


XkbDeviceBellEvent - Creates a bell event for an X input extension device or for the keyboard, without ringing the corresponding bell


Bool XkbDeviceBellEvent
(Display *display, Window window, unsigned int device_spec, unsigned int bell_class, unsigned int bell_id, int percent, Atom name);


- display
connection to the X server
- window
event window, or None
- device_spec
device ID, or XkbUseCoreKbd
- bell_class
input extension bell class for the event
- bell_id
input extension bell ID for the event
- percent
volume for the bell, which can range from -100 to 100 inclusive
- name
a bell name, or NULL


The core X protocol allows only applications to explicitly sound the system bell with a given duration, pitch, and volume. Xkb extends this capability by allowing clients to attach symbolic names to bells, disable audible bells, and receive an event whenever the keyboard bell is rung. For the purposes of this document, the audible bell is defined to be the system bell, or the default keyboard bell, as opposed to any other audible sound generated elsewhere in the system. You can ask to receive XkbBellNotify events when any client rings any one of the following:

Return Values

The XkbDeviceBellEvent sends an XkbBellNotify event to to all interested clients and returns True.
If a compatible keyboard extension isn't present in the X server, XkbDeviceBellEvent immediately returns False


Xkb generates XkbBellNotify events for all bells except for those resulting from
calls to XkbForceDeviceBell and XkbForceBell. To receive XkbBellNotify events under all possible conditions, pass XkbBellNotifyMask in both the bits_to_change and values_for_bits parameters to XkbSelectEvents.

The XkbBellNotify event has no event details. It is either selected or it is not. However, you can call XkbSelectEventDetails using XkbBellNotify as the event_type and specifying XkbAllBellNotifyMask in bits_to_change and values_for_bits. This has the same effect as a call to XkbSelectEvents.

The structure for the XkbBellNotify event type contains:

   typedef struct _XkbBellNotify {
       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;    /* XkbBellNotify */
       unsigned int   device;      /* Xkb device ID, will not be XkbUseCoreKbd
       int            percent;     /* requested volume as % of max */
       int            pitch;       /* requested pitch in Hz */
       int            duration;    /* requested duration in microseconds
       unsigned int   bell_class;  /* X input extension feedback class
       unsigned int   bell_id;     /* X input extension feedback ID */
       Atom           name;        /* "name" of requested bell */
       Window         window;      /* window associated with event */
       Bool           event_only;  /* False -> the server did not produce
a beep */
   } XkbBellNotifyEvent;
If your application needs to generate visual bell feedback on the screen when it receives a bell event, use the window ID in the XkbBellNotifyEvent, if present.

See Also

XBell(3) , XkbBellNotify(3) , XkbChangeEnabledControls(3) , XkbDeviceBell(3) , XkbForceBell(3) , XkbForceDeviceBell(3) , XkbSelectEvents(3) , XkbSelectEventDetails(3) , XkbUseCoreKbd(3)

Table of Contents