keyboard bell woes (ignores xset)

Jeremy Huddleston jeremyhu at apple.com
Tue Mar 16 13:12:54 PDT 2010


Actually, as I read this again, I noticed that it is behaving as per the spec:

XBell(dpy, 100) with base = 0:
base - [(base * percent) / 100] + percent = 0 - 0 + 100 = 100

XBell(dpy, 100) with base = 100:
base - [(base * percent) / 100] + percent = 100 - 100 + 100 = 100

So... this just seems a bit deceptive... if 'xset -b' is supposed to mute the keyboard bell, why was XBell() designed to work around this?


On Mar 16, 2010, at 11:47, Jeremy Huddleston wrote:

> I turn off the bell using 'xset -b' :
> ~ $ xset -q | grep bell
>  bell percent:  0    bell pitch:  400    bell duration:  100
> 
> but when I do XBell(dpy, 100), the bell still rings at volume 100.
> 
> #0  DDXRingBell (volume=100, pitch=400, duration=100) at quartzAudio.c:223
> #1  0x0000000100138ba2 in CoreKeyboardBell (volume=100, pDev=0x115b708e0, arg=0x115b71100, something=0) at devices.c:498
> #2  0x0000000100105114 in XkbHandleBell (force=0 '\0', eventOnly=0 '\0', kbd=0x115b708e0, percent=100 'd', pCtrl=0x115b71100, class=0 '\0', name=0, pWin=0x0, pClient=0x115e11c00) at xkbEvents.c:514
> 
> Shouldn't the bell percent set by 'xset' be multiplied by the volume passed to XBell?  From XBell(3):
> 
> """
>       The XBell function rings the bell on the keyboard on the specified display, if possible.  The specified
>       volume is relative to the base volume for the keyboard.  If the value for the percent argument is not in
>       the range -100 to 100 inclusive, a BadValue error results.  The volume at which the bell rings 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]
> """
> 
> --Jeremy
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5820 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100316/48795104/attachment.bin>


More information about the xorg-devel mailing list