diff -urN kbd-1.13/contrib/codepage.c kbd-1.13wip/contrib/codepage.c --- kbd-1.13/contrib/codepage.c 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/contrib/codepage.c 2007-06-25 00:06:03.000000000 +0200 @@ -224,7 +224,7 @@ } if (optL) { int t = CPEntryHeader.device_type; - printf("CPEntryHeader: size=%d dev=%d [%s] name=%8.8s" + printf("CPEntryHeader: size=%d dev=%d [%s] name=%8.8s " "codepage=%d\n\t\tres=%6.6s nxt=%ld off_font=%ld\n\n", CPEntryHeader.size, t, (t==1) ? "screen" : (t==2) ? "printer" : "?", @@ -270,10 +270,6 @@ if (optc) return 0; - fprintf(stderr, - "Warning: CP format is a hack!\n" - "The files produced may or may not be usable!\n"); - sprintf(outfile, "%d.cp", CPEntryHeader.codepage); if ((out = fopen(outfile, "w")) == NULL) { printf("\nUnable to open file %s.\n", outfile); diff -urN kbd-1.13/data/keymaps/i386/azerty/fr-latin9.map kbd-1.13wip/data/keymaps/i386/azerty/fr-latin9.map --- kbd-1.13/data/keymaps/i386/azerty/fr-latin9.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/azerty/fr-latin9.map 2007-06-25 00:06:03.000000000 +0200 @@ -418,7 +418,6 @@ # La touche Ctrl+Pause = Attn = 101 a un code pour elle-même # keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Home diff -urN kbd-1.13/data/keymaps/i386/fgGIod/tr_f-latin5.map kbd-1.13wip/data/keymaps/i386/fgGIod/tr_f-latin5.map --- kbd-1.13/data/keymaps/i386/fgGIod/tr_f-latin5.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/fgGIod/tr_f-latin5.map 2007-06-25 00:06:03.000000000 +0200 @@ -217,7 +217,6 @@ alt keycode 99 = Control_backslash keycode 100 = AltGr keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior diff -urN kbd-1.13/data/keymaps/i386/qwerty/bg_bds-cp1251.map kbd-1.13wip/data/keymaps/i386/qwerty/bg_bds-cp1251.map --- kbd-1.13/data/keymaps/i386/qwerty/bg_bds-cp1251.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/bg_bds-cp1251.map 2007-06-25 00:06:03.000000000 +0200 @@ -638,7 +638,6 @@ keycode 99 = Control_backslash keycode 100 = AltGr keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior diff -urN kbd-1.13/data/keymaps/i386/qwerty/bg-cp1251.map kbd-1.13wip/data/keymaps/i386/qwerty/bg-cp1251.map --- kbd-1.13/data/keymaps/i386/qwerty/bg-cp1251.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/bg-cp1251.map 2007-06-25 00:06:03.000000000 +0200 @@ -312,7 +312,6 @@ altgr alt keycode 99 = Control_backslash keycode 100 = AltGr keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior diff -urN kbd-1.13/data/keymaps/i386/qwerty/br-abnt.map kbd-1.13wip/data/keymaps/i386/qwerty/br-abnt.map --- kbd-1.13/data/keymaps/i386/qwerty/br-abnt.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/br-abnt.map 2007-06-25 00:06:03.000000000 +0200 @@ -197,7 +197,6 @@ alt keycode 99 = Control_backslash keycode 100 = AltGr keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior diff -urN kbd-1.13/data/keymaps/i386/qwerty/by.map kbd-1.13wip/data/keymaps/i386/qwerty/by.map --- kbd-1.13/data/keymaps/i386/qwerty/by.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/by.map 2007-06-25 00:06:03.000000000 +0200 @@ -529,7 +529,6 @@ Meta_Control_backslash Meta_Control_backslash Meta_Control_backslash keycode 100 = Alt keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up Up Up \ KeyboardSignal Up Up \ diff -urN kbd-1.13/data/keymaps/i386/qwerty/cz-cp1250.map kbd-1.13wip/data/keymaps/i386/qwerty/cz-cp1250.map --- kbd-1.13/data/keymaps/i386/qwerty/cz-cp1250.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/cz-cp1250.map 2007-06-25 00:06:03.000000000 +0200 @@ -138,7 +138,6 @@ alt keycode 99 = Control_backslash keycode 100 = AltGr keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior diff -urN kbd-1.13/data/keymaps/i386/qwerty/cz-lat2.map kbd-1.13wip/data/keymaps/i386/qwerty/cz-lat2.map --- kbd-1.13/data/keymaps/i386/qwerty/cz-lat2.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/cz-lat2.map 2007-06-25 00:06:03.000000000 +0200 @@ -138,7 +138,6 @@ alt keycode 99 = Control_backslash keycode 100 = AltGr keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior Scroll_Backward Prior Scroll_Backward VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol diff -urN kbd-1.13/data/keymaps/i386/qwerty/cz-lat2-prog.map kbd-1.13wip/data/keymaps/i386/qwerty/cz-lat2-prog.map --- kbd-1.13/data/keymaps/i386/qwerty/cz-lat2-prog.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/cz-lat2-prog.map 2007-06-25 00:06:03.000000000 +0200 @@ -141,7 +141,6 @@ alt keycode 99 = Control_backslash keycode 100 = AltGr keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior Scroll_Backward Prior Scroll_Backward VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol diff -urN kbd-1.13/data/keymaps/i386/qwerty/cz.map kbd-1.13wip/data/keymaps/i386/qwerty/cz.map --- kbd-1.13/data/keymaps/i386/qwerty/cz.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/cz.map 2007-06-25 00:06:03.000000000 +0200 @@ -1083,13 +1083,13 @@ keycode 100 = AltGr # #keycode 101 = Break -keycode 101 = Break Break VoidSymbol VoidSymbol Control_c \ - Control_c VoidSymbol VoidSymbol VoidSymbol VoidSymbol \ +keycode 101 = Break Break VoidSymbol VoidSymbol VoidSymbol \ + VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol \ VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol \ VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol \ VoidSymbol \ - Break Break VoidSymbol VoidSymbol Control_c \ - Control_c VoidSymbol VoidSymbol VoidSymbol VoidSymbol \ + Break Break VoidSymbol VoidSymbol VoidSymbol \ + VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol \ VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol \ VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol \ VoidSymbol diff -urN kbd-1.13/data/keymaps/i386/qwerty/defkeymap.map kbd-1.13wip/data/keymaps/i386/qwerty/defkeymap.map --- kbd-1.13/data/keymaps/i386/qwerty/defkeymap.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/defkeymap.map 2007-06-25 00:06:03.000000000 +0200 @@ -222,7 +222,6 @@ alt keycode 99 = Control_backslash keycode 100 = AltGr keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior diff -urN kbd-1.13/data/keymaps/i386/qwerty/defkeymap_V1.0.map kbd-1.13wip/data/keymaps/i386/qwerty/defkeymap_V1.0.map --- kbd-1.13/data/keymaps/i386/qwerty/defkeymap_V1.0.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/defkeymap_V1.0.map 2007-06-25 00:06:03.000000000 +0200 @@ -185,7 +185,6 @@ alt keycode 99 = Control_backslash keycode 100 = AltGr keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior diff -urN kbd-1.13/data/keymaps/i386/qwerty/lt.baltic.map kbd-1.13wip/data/keymaps/i386/qwerty/lt.baltic.map --- kbd-1.13/data/keymaps/i386/qwerty/lt.baltic.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/lt.baltic.map 2007-06-25 00:06:03.000000000 +0200 @@ -171,7 +171,6 @@ alt keycode 99 = Control_backslash keycode 100 = AltGr keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior diff -urN kbd-1.13/data/keymaps/i386/qwerty/lt.l4.map kbd-1.13wip/data/keymaps/i386/qwerty/lt.l4.map --- kbd-1.13/data/keymaps/i386/qwerty/lt.l4.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/lt.l4.map 2007-06-25 00:06:03.000000000 +0200 @@ -463,7 +463,6 @@ alt keycode 99 = Control_backslash keycode 100 = AltGr keycode 101 = Break # 101=Control-Pause - control keycode 101 = Control_c string F102 = "\033[7$" keycode 102 = Find # =Home shift keycode 102 = F102 diff -urN kbd-1.13/data/keymaps/i386/qwerty/lt.map kbd-1.13wip/data/keymaps/i386/qwerty/lt.map --- kbd-1.13/data/keymaps/i386/qwerty/lt.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/lt.map 2007-06-25 00:06:03.000000000 +0200 @@ -462,7 +462,6 @@ alt keycode 99 = Control_backslash keycode 100 = AltGr keycode 101 = Break # 101=Control-Pause - control keycode 101 = Control_c string F102 = "\033[7$" keycode 102 = Find # =Home shift keycode 102 = F102 diff -urN kbd-1.13/data/keymaps/i386/qwerty/pl2.map kbd-1.13wip/data/keymaps/i386/qwerty/pl2.map --- kbd-1.13/data/keymaps/i386/qwerty/pl2.map 2007-05-10 21:15:18.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/pl2.map 2007-06-25 00:06:03.000000000 +0200 @@ -242,7 +242,6 @@ alt keycode 99 = Control_backslash keycode 100 = AltGr keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior diff -urN kbd-1.13/data/keymaps/i386/qwerty/sk-prog-qwerty.map kbd-1.13wip/data/keymaps/i386/qwerty/sk-prog-qwerty.map --- kbd-1.13/data/keymaps/i386/qwerty/sk-prog-qwerty.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/sk-prog-qwerty.map 2007-06-25 00:06:03.000000000 +0200 @@ -122,7 +122,6 @@ alt keycode 99 = Control_backslash keycode 100 = AltGr keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior diff -urN kbd-1.13/data/keymaps/i386/qwerty/ua.map kbd-1.13wip/data/keymaps/i386/qwerty/ua.map --- kbd-1.13/data/keymaps/i386/qwerty/ua.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/ua.map 2007-06-25 00:06:03.000000000 +0200 @@ -1515,7 +1515,6 @@ ctrlr keycode 100 = CtrlR_Lock ctrll ctrlr keycode 100 = CtrlR_Lock keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior diff -urN kbd-1.13/data/keymaps/i386/qwerty/ua-utf.map kbd-1.13wip/data/keymaps/i386/qwerty/ua-utf.map --- kbd-1.13/data/keymaps/i386/qwerty/ua-utf.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/ua-utf.map 2007-06-25 00:06:03.000000000 +0200 @@ -1516,7 +1516,6 @@ ctrlr keycode 100 = CtrlR_Lock ctrll ctrlr keycode 100 = CtrlR_Lock keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior diff -urN kbd-1.13/data/keymaps/i386/qwerty/ua-utf-ws.map kbd-1.13wip/data/keymaps/i386/qwerty/ua-utf-ws.map --- kbd-1.13/data/keymaps/i386/qwerty/ua-utf-ws.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/ua-utf-ws.map 2007-06-25 00:06:03.000000000 +0200 @@ -1526,7 +1526,6 @@ ctrlr keycode 100 = CtrlR_Lock ctrll ctrlr keycode 100 = CtrlR_Lock keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior diff -urN kbd-1.13/data/keymaps/i386/qwerty/ua-ws.map kbd-1.13wip/data/keymaps/i386/qwerty/ua-ws.map --- kbd-1.13/data/keymaps/i386/qwerty/ua-ws.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/ua-ws.map 2007-06-25 00:06:03.000000000 +0200 @@ -1521,7 +1521,6 @@ alt keycode 99 = Control_backslash keycode 100 = Alt keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior diff -urN kbd-1.13/data/keymaps/i386/qwerty/us-acentos.map kbd-1.13wip/data/keymaps/i386/qwerty/us-acentos.map --- kbd-1.13/data/keymaps/i386/qwerty/us-acentos.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwerty/us-acentos.map 2007-06-25 00:06:03.000000000 +0200 @@ -194,7 +194,6 @@ alt keycode 99 = Control_backslash keycode 100 = AltGr keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior diff -urN kbd-1.13/data/keymaps/i386/qwertz/cz-us-qwertz.map kbd-1.13wip/data/keymaps/i386/qwertz/cz-us-qwertz.map --- kbd-1.13/data/keymaps/i386/qwertz/cz-us-qwertz.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwertz/cz-us-qwertz.map 2007-06-25 00:06:03.000000000 +0200 @@ -135,7 +135,6 @@ alt keycode 99 = Control_backslash keycode 100 = AltGr keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior Scroll_Backward Prior Scroll_Backward VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol diff -urN kbd-1.13/data/keymaps/i386/qwertz/sk-prog-qwertz.map kbd-1.13wip/data/keymaps/i386/qwertz/sk-prog-qwertz.map --- kbd-1.13/data/keymaps/i386/qwertz/sk-prog-qwertz.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwertz/sk-prog-qwertz.map 2007-06-25 00:06:03.000000000 +0200 @@ -122,7 +122,6 @@ alt keycode 99 = Control_backslash keycode 100 = AltGr keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior diff -urN kbd-1.13/data/keymaps/i386/qwertz/sk-qwertz.map kbd-1.13wip/data/keymaps/i386/qwertz/sk-qwertz.map --- kbd-1.13/data/keymaps/i386/qwertz/sk-qwertz.map 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/data/keymaps/i386/qwertz/sk-qwertz.map 2007-06-25 00:06:03.000000000 +0200 @@ -123,7 +123,6 @@ alt keycode 99 = Control_backslash keycode 100 = AltGr keycode 101 = Break - control keycode 101 = Control_c keycode 102 = Find keycode 103 = Up keycode 104 = Prior diff -urN kbd-1.13/man/man8/kbdrate.8 kbd-1.13wip/man/man8/kbdrate.8 --- kbd-1.13/man/man8/kbdrate.8 2007-05-08 23:12:20.000000000 +0200 +++ kbd-1.13wip/man/man8/kbdrate.8 2007-06-25 00:06:03.000000000 +0200 @@ -22,7 +22,7 @@ without any options will reset the repeat rate to 10.9 characters per second (cps) and the delay to 250 milliseconds (ms) for Intel- and M68K-based systems. These are the IBM defaults. On SPARC-based systems it will reset the repeat rate -to 20 cps and the delay to 200 ms. +to 5 cps and the delay to 200 ms. .SH OPTIONS .TP @@ -69,5 +69,3 @@ .I /etc/rc.local .br .I /dev/port -.br -.I /dev/kbd diff -urN kbd-1.13/src/dumpkeys.c kbd-1.13wip/src/dumpkeys.c --- kbd-1.13/src/dumpkeys.c 2007-05-10 22:25:19.000000000 +0200 +++ kbd-1.13wip/src/dumpkeys.c 2007-06-25 00:06:03.000000000 +0200 @@ -166,10 +166,6 @@ ke.kb_index = 0; ke.kb_table = 0; ke.kb_value = K(t, 0); -#if defined(__mc68000__) || defined(__powerpc__) - /* Keycode 0 is a valid keycode, do not clobber it. */ - ioctl(fd, KDGKBENT, (unsigned long)&ke); -#endif status = (ioctl(fd, KDSKBENT, (unsigned long)&ke) == 0); return status; } @@ -252,13 +248,8 @@ show_short_info(void) { int i; -#if !defined(__mc68000__) && !defined(__powerpc__) printf(_("keycode range supported by kernel: 1 - %d\n"), nr_keys - 1); -#else - printf(_("keycode range supported by kernel: 0 - %d\n"), - NR_KEYS - 1); -#endif printf(_("max number of actions bindable to a key: %d\n"), MAX_NR_KEYMAPS); get_keymaps(); @@ -370,11 +361,7 @@ for (j = 0; j < MAX_NR_KEYMAPS; j++) { int ja = (j | M_ALT); if (j != ja && keymap_index[j] >= 0 && keymap_index[ja] >= 0) -#if !defined(__mc68000__) && !defined(__powerpc__) for (i = 1; i < nr_keys; i++) { -#else - for (i = 0; i < nr_keys; i++) { -#endif int buf0, buf1, type; buf0 = get_bind(i, j); @@ -402,11 +389,7 @@ not_alt_is_meta: no_shorthands: -#if !defined(__mc68000__) && !defined(__powerpc__) for (i = 1; i < nr_keys; i++) { -#else - for (i = 0; i < nr_keys; i++) { -#endif for (j = 0; j < keymapnr; j++) buf[j] = get_bind(i, good_keymap[j]); if (buf[0] == -1) diff -urN kbd-1.13/src/kbdrate.c kbd-1.13wip/src/kbdrate.c --- kbd-1.13/src/kbdrate.c 2007-05-31 08:43:07.000000000 +0200 +++ kbd-1.13wip/src/kbdrate.c 2007-06-25 00:06:03.000000000 +0200 @@ -77,27 +77,21 @@ #ifdef __sparc__ #include +#include #endif #ifndef KDKBDREP /* usually defined in */ #define KDKBDREP 0x4B52 /* set keyboard delay/repeat rate; * actually used values are returned */ -struct kbd_repeat { +#endif + +/* Equal to kernel version, but field names vary. */ +struct my_kbd_repeat { int delay; /* in msec; <= 0: don't change */ -#ifdef __sparc__ - int rate; /* in msec; <= 0: don't change */ -#else int period; /* in msec; <= 0: don't change */ -#endif + /* earlier this field was misnamed "rate" */ }; -#endif /* KDKBDREP */ - -#ifdef __sparc__ -#define KBD_PERIOD(var) var.rate -#else -#define KBD_PERIOD(var) var.period -#endif #include @@ -115,15 +109,15 @@ static int KDKBDREP_ioctl_ok(double rate, int delay, int silent) { -#if defined(KDKBDREP) && !defined(__sparc__) - /* This ioctl is defined in but is not - implemented anywhere - must be in some m68k patches. - We cannot blindly try unimplemented ioctls on sparc64 - - the 32<->64bit transition layer does not like it. */ - struct kbd_repeat kbdrep_s; + /* + * This ioctl is defined in but is not + * implemented anywhere - must be in some m68k patches. + * Since 2.4.9 also on i386. + */ + struct my_kbd_repeat kbdrep_s; /* don't change, just test */ - KBD_PERIOD(kbdrep_s) = -1; + kbdrep_s.period = -1; kbdrep_s.delay = -1; if (ioctl( 0, KDKBDREP, &kbdrep_s )) { if (errno == EINVAL || errno == ENOTTY) @@ -134,16 +128,16 @@ #if 0 printf("old delay %d, period %d\n", - kbdrep_s.delay, KBD_PERIOD(kbdrep_s)); + kbdrep_s.delay, kbdrep_s.period); #endif /* do the change */ if (rate == 0) /* switch repeat off */ - KBD_PERIOD(kbdrep_s) = 0; + kbdrep_s.period = 0; else - KBD_PERIOD(kbdrep_s) = 1000.0 / rate; /* convert cps to msec */ - if (KBD_PERIOD(kbdrep_s) < 1) - KBD_PERIOD(kbdrep_s) = 1; + kbdrep_s.period = 1000.0 / rate; /* convert cps to msec */ + if (kbdrep_s.period < 1) + kbdrep_s.period = 1; kbdrep_s.delay = delay; if (kbdrep_s.delay < 1) kbdrep_s.delay = 1; @@ -154,19 +148,35 @@ } /* report */ - if (KBD_PERIOD(kbdrep_s) == 0) + if (kbdrep_s.period == 0) + rate = 0; + else + rate = 1000.0 / (double) kbdrep_s.period; + + if (!silent) + printf( _("Typematic Rate set to %.1f cps (delay = %d ms)\n"), + rate, kbdrep_s.delay ); + + kbdrep_s.period = -1; + kbdrep_s.delay = -1; + if (ioctl( 0, KDKBDREP, &kbdrep_s )) { + if (errno == EINVAL) + return 0; + perror( "ioctl(KDKBDREP)" ); + exit( 1 ); + } + printf("old delay %d, period %d\n", + kbdrep_s.delay, kbdrep_s.period); + if (kbdrep_s.period == 0) rate = 0; else - rate = 1000.0 / (double) KBD_PERIOD(kbdrep_s); + rate = 1000.0 / (double) kbdrep_s.period; if (!silent) printf( _("Typematic Rate set to %.1f cps (delay = %d ms)\n"), rate, kbdrep_s.delay ); return 1; /* success! */ -#else /* no KDKBDREP or __sparc__ */ - return 0; -#endif /* KDKBDREP */ } static int @@ -181,10 +191,10 @@ exit( 1 ); } - KBD_PERIOD(kbdrate_s) = (int) (rate + 0.5); /* round up */ + kbdrate_s.rate = (int) (rate + 0.5); /* round up */ kbdrate_s.delay = delay * HZ / 1000; /* convert ms to Hz */ - if (KBD_PERIOD(kbdrate_s) > 50) - KBD_PERIOD(kbdrate_s) = 50; + if (kbdrate_s.rate > 50) + kbdrate_s.rate = 50; if (ioctl( fd, KIOCSRATE, &kbdrate_s )) { perror( "ioctl(KIOCSRATE)" ); @@ -194,7 +204,7 @@ if (!silent) printf( "Typematic Rate set to %d cps (delay = %d ms)\n", - KBD_PERIOD(kbdrate_s), kbdrate_s.delay * 1000 / HZ ); + kbdrate_s.rate, kbdrate_s.delay * 1000 / HZ ); return 1; #else /* no KIOCSRATE */ @@ -211,7 +221,7 @@ int main( int argc, char **argv ) { #ifdef __sparc__ - double rate = 20.0; /* Default rate */ + double rate = 5.0; /* Default rate */ int delay = 200; /* Default delay */ #else double rate = 10.9; /* Default rate */ @@ -261,9 +271,8 @@ return 0; - /* The ioport way - will crash on sparc */ + /* The ioport way */ -#ifndef __sparc__ for (i = 0; i < RATE_COUNT; i++) if (rate * 10 >= valid_rates[i]) { value &= 0x60; @@ -326,7 +335,5 @@ valid_rates[value & 0x1f] / 10.0, valid_delays[ (value & 0x60) >> 5 ] ); -#endif - return 0; } diff -urN kbd-1.13/src/setleds.c kbd-1.13wip/src/setleds.c --- kbd-1.13/src/setleds.c 2007-05-08 23:12:21.000000000 +0200 +++ kbd-1.13wip/src/setleds.c 2007-06-25 00:06:03.000000000 +0200 @@ -14,6 +14,10 @@ #include "nls.h" #include "version.h" +#ifdef __sparc__ +#include +#endif + static void usage(void) {