|
ru.linux- RU.LINUX --------------------------------------------------------------------- From : Mike Novikoff 2:5020/730.73 30 Sep 2005 16:10:45 To : Zahar Kiselev Subject : как победить synaptics -------------------------------------------------------------------------------- MN> === gpm-1.20.1-mn-no_synaptics.patch === Заодно уж: >=== gpm-1.20.1-mn-no_twiddler.patch ===< # # *** NOTE!! *** THIS PATCH DEPENDS ON "gpm-1.20.1-mn-no_synaptics.patch" # AND SHOULD BE APPLIED ***AFTER***!! # # Can't be done independently, because they partially # overlap (apply to the same lines). # # "Twiddler keyboard" is now removed as well, to further reduce the bloat # (the things i never use). Less important than Synaptics, not critical # at all, but saves some amount of binary (and maybe memory?) size. # -- mn@lo, 20.03.2005 # diff -ru gpm-1.20.1-syn/doc/doc.gpm.in gpm-1.20.1-s+t/doc/doc.gpm.in --- gpm-1.20.1-syn/doc/doc.gpm.in 2005-03-20 10:49:06.000000000 +0300 +++ gpm-1.20.1-s+t/doc/doc.gpm.in 2005-03-20 00:00:00.000000000 +0300 @@ -751,6 +751,14 @@ Same as above, but in relative mode. @item twid +% +% mn@lo: The first line is for texinfo (note '@@' escaped), +% second is for man (with '.I'talic font, man 7 man). +% +%MSKIP + [*** DISABLED BY mn@@lo, 20.03.2005 ***]. +%M .I +%M [*** DISABLED BY mn@lo, 20.03.2005 ***]. Support for the twiddler keyboard. As of gpm-1.14 this decoder includes a char generator for the text console, but doesn't yet support X keycodes. If used with @samp{-R}, @code{gpm} will anyway diff -ru gpm-1.20.1-syn/src/headers/gpmInt.h gpm-1.20.1-s+t/src/headers/gpmInt.h --- gpm-1.20.1-syn/src/headers/gpmInt.h 2002-12-25 01:57:16.000000000 +0300 +++ gpm-1.20.1-s+t/src/headers/gpmInt.h 2005-03-20 00:00:00.000000000 +0300 @@ -258,8 +258,6 @@ extern int M_listTypes(void); /* special.c */ int processSpecial(Gpm_Event *event); -int twiddler_key(unsigned long message); -int twiddler_key_init(void); /*....................................... Dirty hacks */ diff -ru gpm-1.20.1-syn/src/Makefile.in gpm-1.20.1-s+t/src/Makefile.in --- gpm-1.20.1-syn/src/Makefile.in 2005-03-20 10:49:06.000000000 +0300 +++ gpm-1.20.1-s+t/src/Makefile.in 2005-03-20 00:00:00.000000000 +0300 @@ -13,7 +13,7 @@ # Main portion: regular build rules -GSRC = main.c gpm.c gpn.c mice.c special.c twiddler.c \ +GSRC = main.c gpm.c gpn.c mice.c special.c \ startup.c server_tools.c GOBJ = $(GSRC:.c=.o) report.o tools.o @@ -24,7 +24,7 @@ PICS = $(LOBJ:.o=.lo) -HDRS = gpm.h gpmInt.h twiddler.h message.h +HDRS = gpm.h gpmInt.h message.h PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c @@ -143,7 +143,7 @@ $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.a -prog/mouse-test: mice.o twiddler.o +prog/mouse-test: mice.o $(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a diff -ru gpm-1.20.1-syn/src/mice.c gpm-1.20.1-s+t/src/mice.c --- gpm-1.20.1-syn/src/mice.c 2005-03-20 10:49:06.000000000 +0300 +++ gpm-1.20.1-s+t/src/mice.c 2005-03-20 00:00:00.000000000 +0300 @@ -72,7 +72,6 @@ #include "headers/gpmInt.h" -#include "headers/twiddler.h" #include "headers/message.h" /*========================================================================*/ @@ -1025,120 +1024,6 @@ return 0; } -static int M_twid(Gpm_Event *state, unsigned char *data) -{ - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; - - /* build the message as a single number */ - for (i=0; i<5; i++) - message |= (data[i]&0x7f)<<(i*7); - key = message & TW_ANY_KEY; - - if ((message & TW_MOD_M) == 0) { /* manage keyboard */ - if (((message & TW_ANY_KEY) != lastkey) || autorepeat) - autorepeat = twiddler_key(message); - lastkey = key; - lock = 0; return -1; /* no useful mouse data */ - } - - switch (message & TW_ANY1) { - case TW_L1: state->buttons = GPM_B_RIGHT; break; - case TW_M1: state->buttons = GPM_B_MIDDLE; break; - case TW_R1: state->buttons = GPM_B_LEFT; break; - case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ - if (message & TW_ANY2) state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) state->buttons |= GPM_B_LEFT; - if (message & TW_R3) state->buttons |= GPM_B_RIGHT; - - /* put in modifiers information */ - { - struct {unsigned long in, out;} *ptr, list[] = { - { TW_MOD_S, 1<<KG_SHIFT }, - { TW_MOD_C, 1<<KG_CTRL }, - { TW_MOD_A, 1<<KG_ALT }, - { 0, 0} - }; - for (ptr = list; ptr->in; ptr++) - if(message & ptr->in) state->modifiers |= ptr->out; - } - - /* now extraxt H/V */ - h = (message >> TW_H_SHIFT) & TW_M_MASK; - v = (message >> TW_V_SHIFT) & TW_M_MASK; - if (h & TW_M_BIT) h = -(TW_M_MASK + 1 - h); - if (v & TW_M_BIT) v = -(TW_M_MASK + 1 - v); - -#ifdef TWIDDLER_STATIC - /* static implementation: return movement */ - if (!lock) { - lasth = h; - lastv = v; - lock = 1; - } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; - -#elif defined(TWIDDLER_BALLISTIC) - { - /* in case I'll change the resolution */ - static int tw_threshold = 5; /* above this it moves */ - static int tw_scale = 5; /* every 5 report one */ - - if (h > -tw_threshold && h < tw_threshold) state->dx=0; - else { - h = h - (h<0)*tw_threshold +lasth; - lasth = h%tw_scale; - state->dx = -(h/tw_scale); - } - if (v > -tw_threshold && v < tw_threshold) state->dy=0; - else { - v = v - (v<0)*tw_threshold +lastv; - lastv = v%tw_scale; - state->dy = -(v/tw_scale); - } - } - -#else /* none defined: use mixed approach */ - { - /* in case I'll change the resolution */ - static int tw_threshold = 60; /* above this, movement is ballistic */ - static int tw_scale = 10; /* ball: every 6 units move one unit */ - static int tw_static_scale = 3; /* stat: every 3 units move one unit */ - static int lasthrest, lastvrest; /* integral of small motions uses rest */ - - if (!lock) { - lasth = h; lasthrest = 0; - lastv = v; lastvrest = 0; - lock = 1; - } - - if (h > -tw_threshold && h < tw_threshold) { - state->dx = -(h-lasth+lasthrest)/tw_static_scale; - lasthrest = (h-lasth+lasthrest)%tw_static_scale; - } else /* ballistic */ { - h = h - (h<0)*tw_threshold + lasthrest; - lasthrest = h%tw_scale; - state->dx = -(h/tw_scale); - } - lasth = h; - if (v > -tw_threshold && v < tw_threshold) { - state->dy = -(v-lastv+lastvrest)/tw_static_scale; - lastvrest = (v-lastv+lastvrest)%tw_static_scale; - } else /* ballistic */ { - v = v - (v<0)*tw_threshold + lastvrest; - lastvrest = v%tw_scale; - state->dy = -(v/tw_scale); - } - lastv = v; - } -#endif - - /* fprintf(stderr,"%4i %4i -> %3i %3i\n",h,v,state->dx,state->dy); */ - return 0; -} #ifdef HAVE_LINUX_JOYSTICK_H /* Joystick mouse emulation (David Given) */ @@ -1891,21 +1776,6 @@ return type; } -static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - - if (check_no_argv(argc, argv)) return NULL; - - if (twiddler_key_init() != 0) return NULL; - /* - * the twiddler is a serial mouse: just drop dtr - * and run at 2400 (unless specified differently) - */ - if(opt_baud==DEF_BAUD) opt_baud = 2400; - argv[1] = "dtr"; /* argv[1] is guaranteed to be NULL (this is dirty) */ - return I_serial(fd, flags, type, argc, argv); -} static Gpm_Type *I_calus(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) @@ -2269,9 +2139,6 @@ {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", "", M_summa, I_summa, STD_FLG, {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, >=== gpm-1.20.1-mn-no_twiddler.patch ===< MN> P.S. /usr/bin/patch --ignore-whitespace MN> "...because tabs are technically not allowed in FidoNet technology MN> messages" -- golded+-1.1.4.7/gold_ref.txt Mike --- * Origin: mn@lo.lan (2:5020/730.73) Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.linux/3932433d2d7b.html, оценка из 5, голосов 10
|