1 Patch from Matthias Goebl <oe@m.goebl.net>
2 Added via OE bugtracker: bug #478
4 --- console-tools-0.3.2/kbdtools/kbd_mode.c.orig
5 +++ console-tools-0.3.2/kbdtools/kbd_mode.c
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)"));
13 OPT("-h --help ", HELPDESC);
14 OPT("-V --version ", VERSIONDESC);
20 static int parse_cmdline (int argc, char *argv[])
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' },
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)
43 + rate = atoi(optarg);
47 + delay = atoi(optarg);
57 + if ( rate != -1 || delay != -1 )
59 + struct kbd_repeat kbd_rep;
60 + kbd_rep.delay = delay;
61 + kbd_rep.period = rate;
62 + if (ioctl(fd, KDKBDREP, &kbd_rep))
64 + fprintf(stderr, progname);
65 + perror(_(": error setting keyboard repeat mode\n"));
68 + if(mode==-2) exit(0);
71 if (ioctl(fd, KDSKBMODE, mode))
73 fprintf(stderr, progname);