Re: jumping erratic mouse cursor
From: Robert (16ja5ko02_at_sneakemail.com)
Date: 12/19/04
- Previous message: J.O. Aho: "Re: Freedesktop vs. Xfree86, xprint etc."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 19 Dec 2004 01:43:22 GMT
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 @@
exit(0);
}
+/*-------------------------------------------------------------------*/
+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);
}
- Previous message: J.O. Aho: "Re: Freedesktop vs. Xfree86, xprint etc."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]