2 .\" Copyright 1999 Oracle and/or its affiliates. All rights reserved.
4 .\" Permission is hereby granted, free of charge, to any person obtaining a
5 .\" copy of this software and associated documentation files (the "Software"),
6 .\" to deal in the Software without restriction, including without limitation
7 .\" the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 .\" and/or sell copies of the Software, and to permit persons to whom the
9 .\" Software is furnished to do so, subject to the following conditions:
11 .\" The above copyright notice and this permission notice (including the next
12 .\" paragraph) shall be included in all copies or substantial portions of the
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 .\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 .\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 .\" THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 .\" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 .\" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 .\" DEALINGS IN THE SOFTWARE.
23 .TH XkbForceBell __libmansuffix__ __xorgversion__ "XKB FUNCTIONS"
25 XkbForceBell \- Overrides user preference settings for audible bells to ring the
26 bell on the default keyboard
30 .BI "(\^Display *" "display" "\^,"
31 .BI "int " "percent" "\^);"
37 connection to the X server
40 volume for the bell, which can range from -100 to 100 inclusive
43 The core X protocol allows only applications to explicitly sound the system bell
45 given duration, pitch, and volume. Xkb extends this capability by allowing clients
47 attach symbolic names to bells, disable audible bells, and receive an event whenever
49 keyboard bell is rung. For the purposes of this document, the
51 bell is defined to be the system bell, or the default keyboard bell, as opposed to
53 other audible sound generated elsewhere in the system.
54 You can ask to receive XkbBellNotify events when any client rings any one of the
60 Any bell on an input device that can be specified by a bell_class and bell_id pair
62 Any bell specified only by an arbitrary name. (This is, from the server's point of
64 merely a name, and not connected with any physical sound-generating device. Some
66 application must generate the sound, or visual feedback, if any, that is associated
71 You can also ask to receive XkbBellNotify events when the server rings the default
73 or if any client has requested events only (without the bell sounding) for any of
75 bell types previously listed.
77 You can disable audible bells on a global basis. For example, a client that replaces
79 keyboard bell with some other audible cue might want to turn off the AudibleBell
81 to prevent the server from also generating a sound and avoid cacophony. If you
83 audible bells and request to receive XkbBellNotify events, you can generate feedback
84 different from the default bell.
86 You can, however, override the AudibleBell control by calling one of the functions
88 force the ringing of a bell in spite of the setting of the AudibleBell control -
92 In this case the server does not generate a bell event.
94 Just as some keyboards can produce keyclicks to indicate when a key is pressed or
95 repeating, Xkb can provide feedback for the controls by using special beep codes.
97 AccessXFeedback control is used to configure the specific types of operations that
102 You can associate a name to an act of ringing a bell by converting the name to an
104 and then using this name when you call the functions listed in this chapter. If an
106 is generated as a result, the name is then passed to all other clients interested in
107 receiving XkbBellNotify events. Note that these are arbitrary names and that there
109 binding to any sounds. Any sounds or other effects (such as visual bells on the
111 must be generated by a client application upon receipt of the bell event containing
113 name. There is no default name for the default keyboard bell. The server does
115 some predefined bells for the AccessX controls. These named bells are shown in the
116 Table 1; the name is included in any bell event sent to clients that have requested to
117 receive XkbBellNotify events.
123 Table 1 Predefined Bells
127 Indicator turned on AX_IndicatorOn
128 Indicator turned off AX_IndicatorOff
129 More than one indicator changed state AX_IndicatorChange
130 Control turned on AX_FeatureOn
131 Control turned off AX_FeatureOff
132 More than one control changed state AX_FeatureChange
134 SlowKeys and BounceKeys about to be turned on or off
135 T} AX_SlowKeysWarning
136 SlowKeys key pressed AX_SlowKeyPress
137 SlowKeys key accepted AX_SlowKeyAccept
138 SlowKeys key rejected AX_SlowKeyReject
139 Accepted SlowKeys key released AX_SlowKeyRelease
140 BounceKeys key rejected AX_BounceKeyReject
141 StickyKeys key latched AX_StickyLatch
142 StickyKeys key locked AX_StickyLock
143 StickyKeys key unlocked AX_StickyUnlock
148 Using Xkb you can generate bell events that do not necessarily ring the system bell.
150 is useful if you need to use an audio server instead of the system beep. For
152 when an audio client starts, it could disable the audible bell (the system bell) and
154 listen for XkbBellNotify events. When it receives a XkbBellNotify event, the audio
156 could then send a request to an audio server to play a sound.
158 You can control the audible bells feature by passing the XkbAudibleBellMask to
159 .I XkbChangeEnabledControls.
160 If you set XkbAudibleBellMask on, the server rings the system bell when a bell event
161 occurs. This is the default. If you set XkbAudibleBellMask off and a bell event
163 the server does not ring the system bell unless you call
164 .I XkbForceDeviceBell
168 Audible bells are also part of the per-client auto-reset controls.
172 Use the functions described in this section to ring bells and to generate bell
175 The input extension has two types of feedbacks that can generate bells - bell
177 and keyboard feedback. Some of the functions in this section have
181 parameters; set them as follows: Set
183 to BellFeedbackClass or KbdFeedbackClass. A device can have more than one feedback
187 to the particular bell feedback of
191 Table 2 shows the conditions that cause a bell to sound or an XkbBellNotifyEvent to be generated when a bell function is
198 Table 2 Bell Sounding and Bell Event Generating
200 Function called AudibleBell Server sounds a bell Server sends an
203 XkbDeviceBell On Yes Yes
204 XkbDeviceBell Off No Yes
207 XkbDeviceBellEvent On or Off No Yes
208 XkbBellEvent On or Off No Yes
209 XkbDeviceForceBell On or Off Yes No
210 XkbForceBell On or Off Yes No
214 If a compatible keyboard extension isn't present in the X server,
222 and returns False. Otherwise,
225 .I XkbForceDeviceBell
229 .I percent, device_spec
238 = NULL, and returns what
239 .I XkbForceDeviceBell
243 does not cause an XkbBellNotify event.
247 without first initializing the keyboard extension.
253 function returns False when a compatible keyboard extension isn't present in the X server.
256 Xkb generates XkbBellNotify events for all bells except for those resulting from
258 .I XkbForceDeviceBell
261 To receive XkbBellNotify events under all possible conditions, pass
270 The XkbBellNotify event has no event details. It is either selected or it is not.
271 However, you can call
272 .I XkbSelectEventDetails
273 using XkbBellNotify as the
275 and specifying XkbAllBellNotifyMask in
279 This has the same effect as a call to
282 The structure for the XkbBellNotify event type contains:
285 typedef struct _XkbBellNotify {
286 int type; /\(** Xkb extension base event code */
287 unsigned long serial; /\(** X server serial number for event */
288 Bool send_event; /\(** True => synthetically generated */
289 Display * display; /\(** server connection where event generated */
290 Time time; /\(** server time when event generated */
291 int xkb_type; /\(** XkbBellNotify */
292 unsigned int device; /\(** Xkb device ID, will not be XkbUseCoreKbd */
293 int percent; /\(** requested volume as % of max */
294 int pitch; /\(** requested pitch in Hz */
295 int duration; /\(** requested duration in microseconds */
296 unsigned int bell_class; /\(** X input extension feedback class */
297 unsigned int bell_id; /\(** X input extension feedback ID */
298 Atom name; /\(** "name" of requested bell */
299 Window window; /\(** window associated with event */
300 Bool event_only; /\(** False -> the server did not produce a beep */
301 } XkbBellNotifyEvent;
304 If your application needs to generate visual bell feedback on the screen when it
306 a bell event, use the window ID in the XkbBellNotifyEvent, if present.
309 .BR XBell (__libmansuffix__),
310 .BR XkbBell (__libmansuffix__),
311 .BR XkbChangeEnabledControls (__libmansuffix__),
312 .BR XkbForceDeviceBell (__libmansuffix__),
313 .BR XkbSelectEventDetails (__libmansuffix__),
314 .BR XkbSelectEvents (__libmansuffix__)