Copyright (c) 1999 - Sun Microsystems, Inc.
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, provided that the above
copyright notice(s) and this permission notice appear in all copies of
the Software and that both the above copyright notice(s) and this
permission notice appear in supporting documentation.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale, use
or other dealings in this Software without prior written authorization
of the copyright holder.
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:
| Table 1 Predefined Bells |
| Action Named Bell |
| Indicator turned on AX_IndicatorOn |
| Indicator turned off AX_IndicatorOff |
| More than one indicator changed state AX_IndicatorChange |
| Control turned on AX_FeatureOn |
| Control turned off AX_FeatureOff |
| More than one control changed state AX_FeatureChange |
| SlowKeys and BounceKeys about to be turned on or off |
| AX_SlowKeysWarning |
| SlowKeys key pressed AX_SlowKeyPress |
| SlowKeys key accepted AX_SlowKeyAccept |
| SlowKeys key rejected AX_SlowKeyReject |
| Accepted SlowKeys key released AX_SlowKeyRelease |
| BounceKeys key rejected AX_BounceKeyReject |
| StickyKeys key latched AX_StickyLatch |
| StickyKeys key locked AX_StickyLock |
| StickyKeys key unlocked AX_StickyUnlock |
| Table 2 Bell Sounding and Bell Event Generating |
| Function called AudibleBell Server sounds a bell Server sends an |
| XkbBellNotifyEvent |
| XkbDeviceBell On Yes Yes |
| XkbDeviceBell Off No Yes |
| XkbBell On Yes Yes |
| XkbBell Off No Yes |
| XkbDeviceBellEvent On or Off No Yes |
| XkbBellEvent On or Off No Yes |
| XkbDeviceForceBell On or Off Yes No |
| XkbForceBell On or Off Yes No |
15 True The XkbDeviceBellEvent sends an XkbBellNotify event to to all interested clients and returns True.
15 False 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.