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