File: 002_force_repeat_000

package info (click to toggle)
gpm 1.20.7-11
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 3,832 kB
  • sloc: ansic: 8,701; yacc: 1,054; sh: 1,034; makefile: 387; cpp: 241; lisp: 222; awk: 82; sed: 6
file content (101 lines) | stat: -rw-r--r-- 5,043 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
Description: Add -F option to force repeat mode
Author: "Zephaniah E. Hull" <warp@whitestar.soark.net>
Date: Wed,  3 Jan 1999 09:07:00 -0400

Index: b/src/headers/message.h
===================================================================
--- a/src/headers/message.h	2008-06-11 05:45:51.000000000 +0300
+++ b/src/headers/message.h	2008-06-11 05:46:30.000000000 +0300
@@ -92,6 +92,7 @@
          "    -R mouse-type    enter repeater mode. X should read /dev/gpmdata\n" \
          "                     like it was a mouse-type device.  Default is MouseSystems.\n" \
          "                     You can also specify \"raw\" to relay the raw device data.\n" \
+         "    -F               Always force repeat mode.\n" \
          "    -s sample-rate   sets the sample rate (default %d)\n" \
          "    -S [commands]    enable special commands (see man page)\n" \
          "    -t mouse-type    sets mouse type (default '%s')\n" \
Index: b/src/daemon/cmdline.c
===================================================================
--- a/src/daemon/cmdline.c	2008-06-11 05:46:23.000000000 +0300
+++ b/src/daemon/cmdline.c	2008-06-11 05:47:24.000000000 +0300
@@ -32,7 +32,7 @@
 void cmdline(int argc, char **argv)
 {
    extern struct options option;
-   char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV23";
+   char options[]="a:A::b:B:d:DFg:hi:kl:m:Mo:pr:R::s:S:t:TuvV23";
    int  opt;
 
    /* initialize for the dual mouse */ 
@@ -60,6 +60,10 @@ void cmdline(int argc, char **argv)
             if (option.repeater_type == 0)
                option.repeater_type = "msc";
             which_mouse=mouse_table+2;                   break;
+         case 'F': option.repeater++; option.force_repeat = 1;
+            if (option.repeater_type == 0)
+               option.repeater_type = "msc";
+            break;
          case 'o': add_mouse(GPM_ADD_OPTIONS,optarg);
                    gpm_report(GPM_PR_DEBUG,"options: %s",optarg);
                    (which_mouse->opt_options) = optarg;                 break; /* GO AWAY */
Index: b/src/headers/daemon.h
===================================================================
--- a/src/headers/daemon.h	2008-06-11 05:45:51.000000000 +0300
+++ b/src/headers/daemon.h	2008-06-11 05:48:40.000000000 +0300
@@ -47,6 +47,7 @@ struct options {
    char           *progname;           /* hopefully gpm ;)                    */
    struct micetab *micelist;           /* mice and their options              */
    char           *consolename;        /* /dev/tty0 || /dev/vc/0              */
+   int            force_repeat;        /* force click repeat                  */
 };
 
 typedef struct Gpm_Cinfo {
Index: b/src/daemon/getmousedata.c
===================================================================
--- a/src/daemon/getmousedata.c	2008-06-11 05:53:27.000000000 +0300
+++ b/src/daemon/getmousedata.c	2008-06-11 05:55:31.000000000 +0300
@@ -48,7 +48,7 @@ char *getMouseData(int fd, Gpm_Type *typ
       return NULL;
    }
 
-   if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep)
+   if ((kd_mode!=KD_TEXT || option.force_repeat) && fifofd != -1 && opt_rawrep)
       write(fifofd, data, howmany);
 
    if ((data[0]&((which_mouse->m_type)->proto)[0]) != ((which_mouse->m_type)->proto)[1]) {
@@ -71,7 +71,8 @@ char *getMouseData(int fd, Gpm_Type *typ
    if((i=(which_mouse->m_type)->packetlen-howmany)) /* still to get */
       do {
          j = read(fd,edata-i,i); /* edata is pointer just after data */
-         if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0)
+         if ((kd_mode!=KD_TEXT || option.force_repeat)
+              && fifofd != -1 && opt_rawrep && j > 0)
             write(fifofd, edata-i, j);
          i -= j;
       } while (i && j);
Index: b/src/daemon/old_main.c
===================================================================
--- a/src/daemon/old_main.c	2008-06-11 05:51:23.000000000 +0300
+++ b/src/daemon/old_main.c	2008-06-11 05:51:46.000000000 +0300
@@ -168,7 +168,7 @@ int old_main()
       if (ioctl(fd, KDGETMODE, &kd_mode) < 0)
          gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE);
       close(fd);
-      if(kd_mode != KD_TEXT && !option.repeater) {
+      if(kd_mode != KD_TEXT && !option.repeater && !option.force_repeat) {
          wait_text(&mouse_table[1].fd);
          maxfd=max(maxfd,mouse_table[1].fd);
          readySet=connSet;
Index: b/src/daemon/processmouse.c
===================================================================
--- a/src/daemon/processmouse.c	2008-06-11 05:51:57.000000000 +0300
+++ b/src/daemon/processmouse.c	2008-06-11 05:52:56.000000000 +0300
@@ -131,7 +131,7 @@ int processMouse(int fd, Gpm_Event *even
 
 /*....................................... we're a repeater, aren't we? */
 
-   if (kd_mode!=KD_TEXT) {
+   if (kd_mode!=KD_TEXT || option.force_repeat) {
       if (fifofd != -1 && ! opt_rawrep) {
          if ((which_mouse->m_type)->absolute) { /* hof Wed Feb  3 21:43:28 MET 1999 */ 
             /* prepare the values from a absolute device for repeater mode */