Re: jumping erratic mouse cursor - X

This is a discussion on Re: jumping erratic mouse cursor - X ; ["Followup-To:" header set to comp.os.linux.x.] On 26 Aug 2004 14:35:07 -0500, Robert staggered into the Black Sun and said: > I use a NoHands Mouse with a serial interface. The regular mouse is a > PS/2, but I configured X ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Re: jumping erratic mouse cursor

  1. Re: jumping erratic mouse cursor

    ["Followup-To:" header set to comp.os.linux.x.]
    On 26 Aug 2004 14:35:07 -0500, Robert staggered into the Black Sun and
    > I use a NoHands Mouse with a serial interface. The regular mouse is a
    > PS/2, but I configured X Windows (via XF86Config) to use the serial

    "X" or "the X Window system", not "X Windows". Most folks just say "X".

    > problems. (1) The mouse pointer jumps all over the place as I move it
    > with my foot (via the NoHands Mouse). (2) Also, my X server behaves
    > strangely when using the serial port for the mouse verses the PS/2
    > mouse. The PS/2 mouse works perfectly, but, when using the serial
    > mouse interface, occassionally the entire X server just freezes up and
    > stops until I move the mouse again. Even the keyboard doesn't work
    > during this time.

    > I was speculating that it might be the IRQ, but I used setserial to
    > examine /dev/ttyS1 and looked at /proc/interrupts and there were no
    > overlaps ('though I did notice that the serial device is not listed in
    > /proc/interrupts).

    /dev/ttyS1 should use IRQ 3 (I think; it's been years since I've used a
    serial device) and should be reported as doing so in /proc/interrupts.
    Which protocol is the mouse set to? "Auto" often works with serial
    mice, but there are exceptions. Post the relevant section from your
    XF86Config file. Also look in /var/log/XFree86.0.log for any errors or
    messages relating to the mouse. I've never tried to use a serial mouse
    in X, but this behavior is atypical.

    > The baud rate is set at 1200

    Is this the only rate the mouse can handle? Mice aren't particularly
    data-intensive, but it might work better at a higher speed.

    > The computer is running RedHat 9 with (I think) a 2.4.X kernel.

    The value of X is important. There are vast differences between a
    2.4.26 (latest) and a 2.4.0 (first of the 2.4 series) kernel.
    Everything before 2.4.10 was basically unusable for production (VM
    problems, etcetera.)

    > I'm sorry I can't dump out the output from setserial and the contents
    > of various /proc files, but the machine is at work and there is strict
    > network security there.

    How annoying. Consult your company's Linux geek; if you don't have a
    company Linux geek, see if the network admin can unbend for long enough
    for you to copy the information down on paper and type it in later. The
    only important bits of /proc/interrupts are IRQs 3 and 4, /proc/ioports
    is not useful here, and the setserial stuff might be useful. The Mouse
    sections of XF86Config and any mouse-related messages in
    /var/log/XFree86.0.log would be really useful to see. HTH,

    Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
    Brainbench MVP for Linux Admin / mail: TRAP + SPAN don't belong / Hire me!

  2. Re: jumping erratic mouse cursor

    In addition, I also changed the gpm source code. Below is the patch:

    --- gpm-1.19.3/gpm.c 2000-07-18 05:06:06.000000000 -0700
    +++ /usr/src/redhat/SOURCES/gpm-1.19.3/gpm.c 2004-10-12 15:21:45.000000000 -0700
    @@ -50,6 +51,7 @@
    extern int errno;

    static void gpm_killed(int);
    +static void gpm_switchbuttons(int);

    * all the values duplicated for dual-mouse operation are
    @@ -995,6 +1014,8 @@

    signal(SIGWINCH,gpm_killed); /* winch can be sent if console is resized */

    + signal(SIGHUP, gpm_switchbuttons);
    /*....................................... create your nodes */

    /* control node */
    @@ -1208,5 +1229,16 @@

    +static void gpm_switchbuttons(int signo)
    + char* tmp;
    + tmp=opt_sequence;
    + opt_sequence=opt_altsequence;
    + opt_altsequence=tmp;
    + signal(SIGHUP, gpm_switchbuttons);

    diff -wru gpm-1.19.3/gpmInt.h /usr/src/redhat/SOURCES/gpm-1.19.3/gpmInt.h
    --- gpm-1.19.3/gpmInt.h 2000-07-18 05:18:54.000000000 -0700
    +++ /usr/src/redhat/SOURCES/gpm-1.19.3/gpmInt.h 2004-10-12 15:18:31.000000000 -0700
    @@ -85,7 +85,7 @@
    /* this structure is used to hide the dual-mouse stuff */

    struct mouse_features {
    - char *opt_type, *opt_dev, *opt_sequence;
    + char *opt_type, *opt_dev, *opt_sequence, *opt_altsequence;
    int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley;
    int opt_time, opt_cluster, opt_three, opt_glidepoint_tap;
    char *opt_options; /* extra textual configuration */
    @@ -101,6 +101,7 @@
    #define opt_type (which_mouse->opt_type)
    #define opt_dev (which_mouse->opt_dev)
    #define opt_sequence (which_mouse->opt_sequence)
    +#define opt_altsequence (which_mouse->opt_altsequence)
    #define opt_baud (which_mouse->opt_baud)
    #define opt_sample (which_mouse->opt_sample)
    #define opt_delta (which_mouse->opt_delta)

    diff -wru gpm-1.19.3/gpn.c /usr/src/redhat/SOURCES/gpm-1.19.3/gpn.c
    --- gpm-1.19.3/gpn.c 2000-07-18 05:06:06.000000000 -0700
    +++ /usr/src/redhat/SOURCES/gpm-1.19.3/gpn.c 2004-10-12 15:19:10.000000000 -0700
    @@ -400,6 +406,7 @@
    for (opt=0; seq[opt].in && strcmp(seq[opt].in,opt_sequence); opt++)
    if (!seq[opt].in) exit(usage("button sequence"));
    + opt_altsequence=strdup(seq[0].out);
    opt_sequence=strdup(seq[opt].out); /* I can rewrite on it */

    /* look for the mouse type */

    diff -wru gpm-1.19.3/mice.c /usr/src/redhat/SOURCES/gpm-1.19.3/mice.c
    --- gpm-1.19.3/mice.c 2000-03-07 06:10:00.000000000 -0800
    +++ /usr/src/redhat/SOURCES/gpm-1.19.3/mice.c 2004-09-20 14:28:29.000000000 -0700
    @@ -426,8 +426,8 @@

    /* sluggish... */
    buffer[0]=(state->buttons ^ 0x07) | 0x80;
    - buffer[3] = state->dx - (buffer[1] = state->dx/2); /* Markus */
    - buffer[4] = -state->dy - (buffer[2] = -state->dy/2);
    + buffer[3] = state->dx/4 - (buffer[1] = state->dx/8); /* Markus */
    + buffer[4] = -state->dy/4 - (buffer[2] = -state->dy/8);
    return write(fd,buffer,5);


+ Reply to Thread