Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!yale!mintaka!bloom-beacon!EXPO.LCS.MIT.EDU!rws From: rws@EXPO.LCS.MIT.EDU (Bob Scheifler) Newsgroups: comp.windows.x Subject: Re: Mouse sensitivity Message-ID: <9007211819.AA01003@expire.lcs.mit.edu> Date: 21 Jul 90 18:19:22 GMT References: <1990Jul21.003849.22863@wrl.dec.com> Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 205 The xset command doesn't accept the numerator *and* denominator value for the XChangePointerControl() command. Now it does. :-) *** /tmp/,RCSt1a00988 Sat Jul 21 14:16:59 1990 --- mit/clients/xset/xset.c Sat Jul 21 14:08:24 1990 *************** *** 1,5 **** /* ! * $XConsortium: xset.c,v 1.54 89/12/10 17:40:29 rws Exp $ */ #include --- 1,5 ---- /* ! * $XConsortium: xset.c,v 1.55 90/07/21 14:07:37 rws Exp $ */ #include *************** *** 6,12 **** /* Copyright Massachusetts Institute of Technology 1985 */ #ifndef lint ! static char *rcsid_xset_c = "$XConsortium: xset.c,v 1.54 89/12/10 17:40:29 rws Exp $"; #endif #include --- 6,12 ---- /* Copyright Massachusetts Institute of Technology 1985 */ #ifndef lint ! static char *rcsid_xset_c = "$XConsortium: xset.c,v 1.55 90/07/21 14:07:37 rws Exp $"; #endif #include *************** *** 54,61 **** int acc_num, acc_denom, threshold; int key, auto_repeat_mode; XKeyboardControl values; ! unsigned long pixels[512]; ! caddr_t colors[512]; int numpixels = 0; char *disp = NULL; Display *dpy; --- 54,62 ---- int acc_num, acc_denom, threshold; int key, auto_repeat_mode; XKeyboardControl values; ! #define MAX_PIXEL_COUNT 512 ! unsigned long pixels[MAX_PIXEL_COUNT]; ! caddr_t colors[MAX_PIXEL_COUNT]; int numpixels = 0; char *disp = NULL; Display *dpy; *************** *** 252,258 **** i++; } else if (*arg >= '0' && *arg <= '9') { ! acc_num = atoi(arg); /* Set acceleration to user's tastes. */ i++; if (i >= argc) { set_mouse(dpy, acc_num, acc_denom, threshold); --- 253,260 ---- i++; } else if (*arg >= '0' && *arg <= '9') { ! acc_denom = 1; ! sscanf(arg, "%d/%d", &acc_num, &acc_denom); i++; if (i >= argc) { set_mouse(dpy, acc_num, acc_denom, threshold); *************** *** 264,270 **** i++; } } ! set_mouse(dpy, acc_num, acc_denom, threshold); } else if (strcmp(arg, "s") == 0) { if (i >= argc) { --- 266,272 ---- i++; } } ! set_mouse(dpy, acc_num, acc_denom, threshold); } else if (strcmp(arg, "s") == 0) { if (i >= argc) { *************** *** 349,354 **** --- 351,358 ---- if (i + 1 >= argc) usage ("missing argument to p", NULL); arg = argv[i]; + if (numpixels >= MAX_PIXEL_COUNT) + usage ("more than %d pixels specified", MAX_PIXEL_COUNT); if (*arg >= '0' && *arg <= '9') pixels[numpixels] = atoi(arg); else *************** *** 661,668 **** set_pixels(dpy, pixels, colors, numpixels) Display *dpy; ! unsigned long pixels[512]; ! caddr_t colors[512]; int numpixels; { XColor def; --- 665,672 ---- set_pixels(dpy, pixels, colors, numpixels) Display *dpy; ! unsigned long *pixels; ! caddr_t *colors; int numpixels; { XColor def; *************** *** 796,803 **** values.bell_percent, values.bell_pitch, values.bell_duration); printf ("Pointer Control:\n"); ! printf (" acceleration: %d = %d / %d threshold: %d\n", ! acc_denom != 0 ? (acc_num / acc_denom) : 0, acc_num, acc_denom, threshold); printf ("Screen Saver:\n"); --- 800,806 ---- values.bell_percent, values.bell_pitch, values.bell_duration); printf ("Pointer Control:\n"); ! printf (" acceleration: %d/%d threshold: %d\n", acc_num, acc_denom, threshold); printf ("Screen Saver:\n"); *************** *** 881,887 **** fprintf (stderr, "\t-led [1-32] led off\n"); fprintf (stderr, "\t led [1-32] led on\n"); fprintf (stderr, " To set mouse acceleration and threshold:\n"); ! fprintf (stderr, "\t m [acc [thr]] m default\n"); fprintf (stderr, " To set pixel colors:\n"); fprintf (stderr, "\t p pixel_value color_name\n"); fprintf (stderr, " To turn auto-repeat off or on:\n"); --- 884,890 ---- fprintf (stderr, "\t-led [1-32] led off\n"); fprintf (stderr, "\t led [1-32] led on\n"); fprintf (stderr, " To set mouse acceleration and threshold:\n"); ! fprintf (stderr, "\t m [acc_mult[/acc_div] [thr]] m default\n"); fprintf (stderr, " To set pixel colors:\n"); fprintf (stderr, "\t p pixel_value color_name\n"); fprintf (stderr, " To turn auto-repeat off or on:\n"); *************** *** 891,897 **** fprintf (stderr, "\t s [timeout [cycle]] s default s on\n"); fprintf (stderr, "\t s blank s noblank s off\n"); fprintf (stderr, "\t s expose s noexpose\n"); ! fprintf (stderr, " For status information: q or query\n"); exit(0); } --- 894,900 ---- fprintf (stderr, "\t s [timeout [cycle]] s default s on\n"); fprintf (stderr, "\t s blank s noblank s off\n"); fprintf (stderr, "\t s expose s noexpose\n"); ! fprintf (stderr, " For status information: q\n"); exit(0); } *** /tmp/,RCSt1a00993 Sat Jul 21 14:17:23 1990 --- mit/clients/xset/xset.man Sat Jul 21 14:07:10 1990 *************** *** 9,15 **** [-c] [c on/off] [c [\fIvolume\fP]] [[-+]fp[-+=] \fIpath\fP[,\fIpath\fP[,...]]] [fp default] [fp rehash] [[-]led [\fIinteger\fP]] [led on/off] ! [m[ouse] [\fIacceleration\fP [\fIthreshold\fP]]] [m[ouse] default] [p \fIpixel\fP \fIcolor\fP] [[-]r] [r on/off] [s [\fIlength\fP [\fIperiod\fP]]] [s blank/noblank] --- 9,15 ---- [-c] [c on/off] [c [\fIvolume\fP]] [[-+]fp[-+=] \fIpath\fP[,\fIpath\fP[,...]]] [fp default] [fp rehash] [[-]led [\fIinteger\fP]] [led on/off] ! [m[ouse] [\fIaccel_mult\fP[/\fIaccel_div\fP] [\fIthreshold\fP]]] [m[ouse] default] [p \fIpixel\fP \fIcolor\fP] [[-]r] [r on/off] [s [\fIlength\fP [\fIperiod\fP]]] [s blank/noblank] *************** *** 112,117 **** --- 112,119 ---- .B m The \fBm\fP option controls the mouse parameters. The parameters for the mouse are `acceleration' and `threshold'. + The acceleration can be specified as an integer, or as a simple + fraction. The mouse, or whatever pointer the machine is connected to, will go `acceleration' times as fast when it travels more than `threshold' pixels in a short time. This way, the mouse can be used for precise