Copyright 2003 by orc@pell.chi.il.us (Jessica L. Parsons) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee. Jessica L. Parsons makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. JESSICA L. PARSONS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL JESSICA L. PARSONS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTIONS, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff -rc gpm-1.19.6/src/gpm.c gpm-1.19.6o/src/gpm.c *** gpm-1.19.6/src/gpm.c Mon Oct 1 13:02:25 2001 --- gpm-1.19.6o/src/gpm.c Wed May 14 11:30:33 2003 *************** *** 780,785 struct stat statbuf; uid_t uid; char tty[20]; /*....................................... Accept */ --- 780,786 ----- struct stat statbuf; uid_t uid; char tty[20]; + time_t staletime; /*....................................... Accept */ diff -rc gpm-1.19.6/src/mice.c gpm-1.19.6o/src/mice.c *** gpm-1.19.6/src/mice.c Thu Sep 27 05:50:29 2001 --- gpm-1.19.6o/src/mice.c Wed May 14 12:51:20 2003 *************** *** 1300,1305 return 0; } /*========================================================================*/ /* Then, mice should be initialized */ --- 1300,1341 ----- return 0; } + /* Cross iPen tablet -- orc@pell.chi.il.us + */ + static int + M_ipen(Gpm_Event *state, unsigned char *buf) + { + long int x, y; + + x = buf[1] | (buf[2] << 7); + y = 5230 - (buf[3] | (buf[4] << 7)); + + state->x = (x * win.ws_col) / 7000; + realposx = (x * 16383L) / 7000L; + state->y = (y * win.ws_row) / 5230; + realposy = (y * 16383L) / 5230L; + + state->buttons = ( (buf[0] & 0x01) ? GPM_B_LEFT : 0) + | ( (buf[0] & 0x02) ? GPM_B_RIGHT : 0); + return 0; + } + + static int + R_ipen(Gpm_Event *state, int mouse) + { + signed char packet[5]; + + packet[0] = 0x98 + ((state->buttons&GPM_B_LEFT) ? 1 : 0) + + ((state->buttons&GPM_B_RIGHT) ? 3 : 0); + + packet[1] = realposx & 0177; + packet[2] = (realposx >> 7) & 0177; + packet[3] = realposy & 0177; + packet[4] = (realposy >> 7) & 0177; + + return write(mouse, packet, 5); + } + /*========================================================================*/ /* Then, mice should be initialized */ *************** *** 2035,2040 return type; } /*========================================================================*/ /* Finally, the table */ #define STD_FLG (CREAD|CLOCAL|HUPCL) --- 2071,2107 ----- return type; } + /* Cross iPen tablet (orc@pell.chi.il.us ) */ + static Gpm_Type * + I_ipen(int mouse, unsigned short flags, struct Gpm_Type *ret, int ac, char**av) + { + struct termios tty; + int sig; + + tcgetattr(mouse, &tty); + tty.c_iflag = IGNBRK | IGNPAR; + tty.c_oflag = 0; + tty.c_lflag = 0; + tty.c_line = 0; + tty.c_cc[VTIME] = 0; + tty.c_cc[VMIN] = 1; + tty.c_cflag = B19200|CS8|CREAD|CLOCAL|HUPCL; + tcsetattr(mouse, TCSAFLUSH, &tty); + + sig = TIOCM_DTR|TIOCM_RTS; + ioctl(mouse, TIOCMBIS, &sig); + usleep(500); + sig = TIOCM_RTS; + ioctl(mouse, TIOCMBIC, &sig); + usleep(2); + sig = TIOCM_RTS; + ioctl(mouse, TIOCMBIS, &sig); + usleep(20); + write(mouse, "@C0", 3); + + return ret; + } + /*========================================================================*/ /* Finally, the table */ #define STD_FLG (CREAD|CLOCAL|HUPCL) *************** *** 2168,2173 "wizardpad", M_wp, I_wp, STD_FLG, {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, {"", "", "", NULL, NULL, 0, {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} --- 2235,2244 ----- "wizardpad", M_wp, I_wp, STD_FLG, {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, + {"ipen", "Cross iPen tablet", + "", M_ipen, I_ipen, STD_FLG, + {0xA0, 0xA0, 0x80, 0x00}, 5, 1, 0, 1, R_ipen}, + {"", "", "", NULL, NULL, 0, {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} *************** *** 2183,2191 printf("\n" GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); printf("Available mouse types are:\n\n"); printf("r name synonym description\n\n"); ! for (type=mice; type->fun; type++) ! printf("%c %-8s %s\n Synonyms: %s\n", type->repeat_fun ?'*':' ', ! type->name, type->desc, type->synonyms); putchar('\n'); --- 2254,2265 ----- printf("\n" GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); printf("Available mouse types are:\n\n"); printf("r name synonym description\n\n"); ! for (type=mice; type->fun; type++) { ! printf("%c %-8s %s\n", type->repeat_fun ? '*' : ' ', ! type->name, type->desc); ! if (type->synonyms && *type->synonyms) ! printf("%11sSynonyms: %s\n", "", type->synonyms); ! } putchar('\n'); diff -rc gpm-1.19.6/src/mouse-test.c gpm-1.19.6o/src/mouse-test.c *** gpm-1.19.6/src/mouse-test.c Mon Oct 1 14:30:31 2001 --- gpm-1.19.6o/src/mouse-test.c Thu May 15 12:07:22 2003 *************** *** 262,269 fd_set checkSet; int pending, maxfd; int trial, readamount,packetsize,got; ! int baudtab[4]={1200,9600,4800,2400}; ! #define BAUD(i) (baudtab[(i)%4]) if (!isatty(fileno(stdin))) { fprintf(stderr,"%s: stdin: not a tty\n",argv[0]); exit(1); } --- 262,269 ----- fd_set checkSet; int pending, maxfd; int trial, readamount,packetsize,got; ! int baudtab[5]={1200,9600,4800,2400,19200}; ! #define BAUD(i) (baudtab[(i)%5]) if (!isatty(fileno(stdin))) { fprintf(stderr,"%s: stdin: not a tty\n",argv[0]); exit(1); }