summaryrefslogtreecommitdiffstats
path: root/meta/packages/console-tools/console-tools-0.3.2/kbdrate.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/console-tools/console-tools-0.3.2/kbdrate.patch')
-rw-r--r--meta/packages/console-tools/console-tools-0.3.2/kbdrate.patch73
1 files changed, 73 insertions, 0 deletions
diff --git a/meta/packages/console-tools/console-tools-0.3.2/kbdrate.patch b/meta/packages/console-tools/console-tools-0.3.2/kbdrate.patch
new file mode 100644
index 0000000000..47d7ea54b9
--- /dev/null
+++ b/meta/packages/console-tools/console-tools-0.3.2/kbdrate.patch
@@ -0,0 +1,73 @@
1Patch from Matthias Goebl <oe@m.goebl.net>
2Added via OE bugtracker: bug #478
3
4--- console-tools-0.3.2/kbdtools/kbd_mode.c.orig
5+++ console-tools-0.3.2/kbdtools/kbd_mode.c
6@@ -29,11 +29,16 @@
7 OPT("-u --unicode ", _("UTF-8 mode (UNICODE)"));
8 OPT("-s --scancode ", _("scancode mode (RAW)"));
9 OPT(" --mode={8bit,keycode,unicode,scancode} ", _("set mode"));
10+ OPT("-r --rate=RATE ", _("set repeat rate (default: 33)"));
11+ OPT("-d --delay=DELAY ", _("set repeat delay (default: 250)"));
12
13 OPT("-h --help ", HELPDESC);
14 OPT("-V --version ", VERSIONDESC);
15 }
16
17+int rate=-1;
18+int delay=-1;
19+
20 static int parse_cmdline (int argc, char *argv[])
21 {
22 int mode = -1;
23@@ -46,11 +51,13 @@
24 { "mode" , required_argument, NULL, 'm' },
25 { "scancode" , no_argument, NULL, 's' },
26 { "unicode" , no_argument, NULL, 'u' },
27+ { "rate" , required_argument, NULL, 'r' },
28+ { "delay" , required_argument, NULL, 'd' },
29 { NULL, 0, NULL, 0 }
30 };
31 int c;
32
33- while ( (c = getopt_long (argc, argv, "Vhaksu", long_opts, NULL)) != EOF)
34+ while ( (c = getopt_long (argc, argv, "Vhaksur:d:", long_opts, NULL)) != EOF)
35 switch (c) {
36 case 'h':
37 usage ();
38@@ -58,6 +65,14 @@
39 case 'V':
40 version ();
41 exit(0);
42+ case 'r':
43+ rate = atoi(optarg);
44+ mode = -2;
45+ break;
46+ case 'd':
47+ delay = atoi(optarg);
48+ mode = -2;
49+ break;
50 case 'a':
51 mode = K_XLATE;
52 break;
53@@ -129,6 +144,20 @@
54 exit(0);
55 }
56
57+ if ( rate != -1 || delay != -1 )
58+ {
59+ struct kbd_repeat kbd_rep;
60+ kbd_rep.delay = delay;
61+ kbd_rep.period = rate;
62+ if (ioctl(fd, KDKBDREP, &kbd_rep))
63+ {
64+ fprintf(stderr, progname);
65+ perror(_(": error setting keyboard repeat mode\n"));
66+ exit(1);
67+ }
68+ if(mode==-2) exit(0);
69+ }
70+
71 if (ioctl(fd, KDSKBMODE, mode))
72 {
73 fprintf(stderr, progname);