XDEVICEBELL(3)

๐Ÿ’– XDEVICEBELL ๐Ÿ’–

okay bestie, welcome to XDeviceBell(3) โ€” the input-extension girly whose whole entire job is making a device go ding. it's part of the XInput crew, and fr fr she's the one you call when you want a bell rung on a device that's living that input-extension life. let's get into it ๐ŸŽ€


โœจ NAME โœจ

XDeviceBell โ€” ring a bell on a device supported through the input extension ๐Ÿ””

like. that's it. that's the whole vibe. she rings bells. on devices. through the input extension. iconic behavior honestly.


๐ŸŒธ SYNOPSIS ๐ŸŒธ

#include <X11/extensions/XInput.h>

Status XDeviceBell( Display *display,
                    XDevice *device,
                    XID feedbackclass,
                    XID feedbackid,
                    int percent);

and here's the tea on every single argument, no skips, no shortcuts:

  • display โ€” the connection to the X server. your whole little link to the server, she needs it.
  • device โ€” the device that the bell is associated with. yes, THAT device.
  • feedbackclass โ€” the class of the feedback that the bell is associated with.
  • feedbackid โ€” the id of the feedback that the bell is associated with.
  • percent โ€” the volume, in the range -100 to 100, at which the bell should be rung. yes, negative is allowed, we love a range ๐Ÿ’…

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so like, the XDeviceBell request causes the server to ring a bell on the specified feedback of the specified device, if possible. that "if possible" is doing a LOT of heavy lifting, bestie, respect it.

the specified volume is relative to the base volume for the bell. okay so important: relative, not absolute. she's not setting the volume, she's doing math ON the volume. very main character of her.

if an invalid device is specified, a BadDevice error will be returned. ๐Ÿ™ˆ

the feedbackclass and feedbackid parameters contain values returned by an XGetFeedbackControl request, and they uniquely identify the bell to ring. so like, you get those values from XGetFeedbackControl, you don't just make them up. no cap.

and here's where it gets spicy: if a feedbackclass is specified that does not support a bell, or if a nonexistent feedbackid is specified, or a percent value is specified that is not in the range -100 to 100 โ€” you get a BadValue error. three strikes, one error, that's the rule ๐Ÿซถ


๐Ÿงฎ the volume math (yes there's math, stay with me)

the volume at which the bell is rung when the percent argument is nonnegative is:

base - [(base * percent) / 100] + percent

the volume at which the bell rings when the percent argument is negative is:

base + [(base * percent) / 100]

see? two formulas, one for nonnegative, one for negative. they're different. don't mix them up. that would be a whole mess. ๐Ÿ˜ญ


๐ŸŽš๏ธ changing the base volume

to change the base volume of the bell, use XChangeFeedbackControl. that's the one that actually moves the base, XDeviceBell just plays relative to it. iykyk.

โญ and just so you're not surprised later: XDeviceBell can generate a BadDevice or a BadValue error. those are the only two. she keeps it cute and contained.

๐Ÿ’€ DIAGNOSTICS ๐Ÿ’€

  • BadDevice โ€” an invalid device was specified. the specified device does not exist, or has not been opened by this client via XOpenInputDevice. so either she's not real, or you never opened her. either way, no bell for you bestie ๐Ÿ˜ญ
  • BadValue โ€” an invalid feedbackclass, feedbackid, or percent value was specified. one of the three was off. check all three, don't assume. periodt.

๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

go read those too, they're the friends in the group chat who fill in the blanks ๐Ÿ’œ


and that's the whole page, bestie!! ๐ŸŒˆโœจ

this little love letter comes to you from the XDEVICEBELL(3) manual, dated 05/18/2026. mwah ๐Ÿ’…๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from