[R] How to turn off the beep made by locator()?

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Thu Feb 28 23:22:55 CET 2002


Stephen Eglen <eglen at pcg.wustl.edu> writes:

> If other people can silence the XBell on Unix, I'd be grateful to know
> how.  Otherwise, I'll volunteer to submit a patch that allows the bell
> to be switched off (perhaps using GetOption("bell")) at least for the
> devices (X11, GNOME) that I should be able to test.  Or, perhaps the
> easiest things would be to remove the few lines that make R beep in
> response to the mouse clicks, unless people think them useful.  (bells
> are also used by data.entry() -- see dataentry.c).  I've also made a
> pass through the win32 and GNOME drivers, and think I can see where
> the beep is generated in those drivers.
> 
> /src/modules/X11/devX11.c, line 1726:
>   		       /* Make a beep! Was print "\07", but that 
>                           messes up some terminals. */
>                     XBell(display, X_BELL_VOLUME);
> 		    XSync(display, 0);

A quick glance at the man page for XBell suggests that to get the
volume to be identical to that of the keyboard, we should set
X_BELL_VOLUME to 0, rather than 50 as it is now. The relation is
supposed to be (for percent >= 0)

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

which you may note gives a positive value even when base is zero.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list