Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 196390
Collapse All | Expand All

(-)kbd-1.13/contrib/codepage.c (-5 / +1 lines)
Lines 224-230 Link Here
224
	}
224
	}
225
	if (optL) {
225
	if (optL) {
226
	    int t = CPEntryHeader.device_type;
226
	    int t = CPEntryHeader.device_type;
227
	    printf("CPEntryHeader: size=%d dev=%d [%s] name=%8.8s"
227
	    printf("CPEntryHeader: size=%d dev=%d [%s] name=%8.8s "
228
"codepage=%d\n\t\tres=%6.6s nxt=%ld off_font=%ld\n\n",
228
"codepage=%d\n\t\tres=%6.6s nxt=%ld off_font=%ld\n\n",
229
		   CPEntryHeader.size,
229
		   CPEntryHeader.size,
230
		   t, (t==1) ? "screen" : (t==2) ? "printer" : "?",
230
		   t, (t==1) ? "screen" : (t==2) ? "printer" : "?",
Lines 270-279 Link Here
270
	if (optc)
270
	if (optc)
271
	  return 0;
271
	  return 0;
272
272
273
        fprintf(stderr,
274
		"Warning: CP format is a hack!\n"
275
		"The files produced may or may not be usable!\n");
276
277
	sprintf(outfile, "%d.cp", CPEntryHeader.codepage);
273
	sprintf(outfile, "%d.cp", CPEntryHeader.codepage);
278
	if ((out = fopen(outfile, "w")) == NULL) {
274
	if ((out = fopen(outfile, "w")) == NULL) {
279
	    printf("\nUnable to open file %s.\n", outfile);
275
	    printf("\nUnable to open file %s.\n", outfile);
(-)kbd-1.13/data/keymaps/i386/azerty/fr-latin9.map (-1 lines)
Lines 418-424 Link Here
418
# La touche Ctrl+Pause = Attn = 101 a un code pour elle-même
418
# La touche Ctrl+Pause = Attn = 101 a un code pour elle-même
419
#
419
#
420
keycode 101 = Break
420
keycode 101 = Break
421
	control keycode 101 = Control_c
422
421
423
keycode 102 = Home
422
keycode 102 = Home
424
423
(-)kbd-1.13/data/keymaps/i386/fgGIod/tr_f-latin5.map (-1 lines)
Lines 217-223 Link Here
217
	alt     keycode  99 = Control_backslash
217
	alt     keycode  99 = Control_backslash
218
keycode 100 = AltGr           
218
keycode 100 = AltGr           
219
keycode 101 = Break
219
keycode 101 = Break
220
	control keycode 101 = Control_c
221
keycode 102 = Find            
220
keycode 102 = Find            
222
keycode 103 = Up              
221
keycode 103 = Up              
223
keycode 104 = Prior           
222
keycode 104 = Prior           
(-)kbd-1.13/data/keymaps/i386/qwerty/bg_bds-cp1251.map (-1 lines)
Lines 638-644 Link Here
638
keycode  99 = Control_backslash
638
keycode  99 = Control_backslash
639
keycode 100 = AltGr           
639
keycode 100 = AltGr           
640
keycode 101 = Break           
640
keycode 101 = Break           
641
	control keycode 101 = Control_c
642
keycode 102 = Find            
641
keycode 102 = Find            
643
keycode 103 = Up              
642
keycode 103 = Up              
644
keycode 104 = Prior           
643
keycode 104 = Prior           
(-)kbd-1.13/data/keymaps/i386/qwerty/bg-cp1251.map (-1 lines)
Lines 312-318 Link Here
312
	altgr	alt	keycode  99 = Control_backslash
312
	altgr	alt	keycode  99 = Control_backslash
313
keycode 100 =	AltGr
313
keycode 100 =	AltGr
314
keycode 101 =	Break
314
keycode 101 =	Break
315
	control keycode 101 = Control_c
316
keycode 102 =	Find
315
keycode 102 =	Find
317
keycode 103 =	Up
316
keycode 103 =	Up
318
keycode 104 =	Prior
317
keycode 104 =	Prior
(-)kbd-1.13/data/keymaps/i386/qwerty/br-abnt.map (-1 lines)
Lines 197-203 Link Here
197
	alt	keycode  99 = Control_backslash
197
	alt	keycode  99 = Control_backslash
198
keycode 100 = AltGr           
198
keycode 100 = AltGr           
199
keycode 101 = Break           
199
keycode 101 = Break           
200
	control keycode 101 = Control_c
201
keycode 102 = Find            
200
keycode 102 = Find            
202
keycode 103 = Up              
201
keycode 103 = Up              
203
keycode 104 = Prior           
202
keycode 104 = Prior           
(-)kbd-1.13/data/keymaps/i386/qwerty/by.map (-1 lines)
Lines 529-535 Link Here
529
		Meta_Control_backslash	Meta_Control_backslash	Meta_Control_backslash
529
		Meta_Control_backslash	Meta_Control_backslash	Meta_Control_backslash
530
keycode 100 =	Alt
530
keycode 100 =	Alt
531
keycode 101 =	Break
531
keycode 101 =	Break
532
	control keycode 101 = Control_c
533
keycode 102 =	Find
532
keycode 102 =	Find
534
keycode 103 =	Up		Up		Up	\
533
keycode 103 =	Up		Up		Up	\
535
		KeyboardSignal	Up		Up	\
534
		KeyboardSignal	Up		Up	\
(-)kbd-1.13/data/keymaps/i386/qwerty/cz-cp1250.map (-1 lines)
Lines 138-144 Link Here
138
	alt keycode 99 = Control_backslash
138
	alt keycode 99 = Control_backslash
139
keycode 100 = AltGr
139
keycode 100 = AltGr
140
keycode 101 = Break
140
keycode 101 = Break
141
	control keycode 101 = Control_c
142
keycode 102 = Find
141
keycode 102 = Find
143
keycode 103 = Up
142
keycode 103 = Up
144
keycode 104 = Prior
143
keycode 104 = Prior
(-)kbd-1.13/data/keymaps/i386/qwerty/cz-lat2.map (-1 lines)
Lines 138-144 Link Here
138
	alt keycode 99 = Control_backslash
138
	alt keycode 99 = Control_backslash
139
keycode 100 = AltGr
139
keycode 100 = AltGr
140
keycode 101 = Break
140
keycode 101 = Break
141
	control keycode 101 = Control_c
142
keycode 102 = Find
141
keycode 102 = Find
143
keycode 103 = Up
142
keycode 103 = Up
144
keycode 104 = Prior Scroll_Backward Prior Scroll_Backward VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol
143
keycode 104 = Prior Scroll_Backward Prior Scroll_Backward VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol
(-)kbd-1.13/data/keymaps/i386/qwerty/cz-lat2-prog.map (-1 lines)
Lines 141-147 Link Here
141
	alt keycode 99 = Control_backslash
141
	alt keycode 99 = Control_backslash
142
keycode 100 = AltGr
142
keycode 100 = AltGr
143
keycode 101 = Break
143
keycode 101 = Break
144
	control keycode 101 = Control_c
145
keycode 102 = Find
144
keycode 102 = Find
146
keycode 103 = Up
145
keycode 103 = Up
147
keycode 104 = Prior Scroll_Backward Prior Scroll_Backward VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol 
146
keycode 104 = Prior Scroll_Backward Prior Scroll_Backward VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol 
(-)kbd-1.13/data/keymaps/i386/qwerty/cz.map (-4 / +4 lines)
Lines 1083-1095 Link Here
1083
keycode 100 = AltGr
1083
keycode 100 = AltGr
1084
#
1084
#
1085
#keycode 101 = Break
1085
#keycode 101 = Break
1086
keycode 101 = Break        Break        VoidSymbol   VoidSymbol   Control_c   \
1086
keycode 101 = Break        Break        VoidSymbol   VoidSymbol   VoidSymbol  \
1087
              Control_c    VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol  \
1087
              VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol  \
1088
              VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol  \
1088
              VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol  \
1089
              VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol  \
1089
              VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol  \
1090
              VoidSymbol                                                      \
1090
              VoidSymbol                                                      \
1091
              Break        Break        VoidSymbol   VoidSymbol   Control_c   \
1091
              Break        Break        VoidSymbol   VoidSymbol   VoidSymbol  \
1092
              Control_c    VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol  \
1092
              VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol  \
1093
              VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol  \
1093
              VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol  \
1094
              VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol  \
1094
              VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol   VoidSymbol  \
1095
              VoidSymbol
1095
              VoidSymbol
(-)kbd-1.13/data/keymaps/i386/qwerty/defkeymap.map (-1 lines)
Lines 222-228 Link Here
222
	alt	keycode  99 = Control_backslash
222
	alt	keycode  99 = Control_backslash
223
keycode 100 = AltGr
223
keycode 100 = AltGr
224
keycode 101 = Break
224
keycode 101 = Break
225
	control keycode 101 = Control_c
226
keycode 102 = Find
225
keycode 102 = Find
227
keycode 103 = Up
226
keycode 103 = Up
228
keycode 104 = Prior
227
keycode 104 = Prior
(-)kbd-1.13/data/keymaps/i386/qwerty/defkeymap_V1.0.map (-1 lines)
Lines 185-191 Link Here
185
	alt	keycode  99 = Control_backslash
185
	alt	keycode  99 = Control_backslash
186
keycode 100 = AltGr
186
keycode 100 = AltGr
187
keycode 101 = Break
187
keycode 101 = Break
188
	control keycode 101 = Control_c
189
keycode 102 = Find
188
keycode 102 = Find
190
keycode 103 = Up
189
keycode 103 = Up
191
keycode 104 = Prior
190
keycode 104 = Prior
(-)kbd-1.13/data/keymaps/i386/qwerty/lt.baltic.map (-1 lines)
Lines 171-177 Link Here
171
	alt	keycode  99 = Control_backslash
171
	alt	keycode  99 = Control_backslash
172
keycode 100 = AltGr           
172
keycode 100 = AltGr           
173
keycode 101 = Break           
173
keycode 101 = Break           
174
	control keycode 101 = Control_c
175
keycode 102 = Find            
174
keycode 102 = Find            
176
keycode 103 = Up              
175
keycode 103 = Up              
177
keycode 104 = Prior           
176
keycode 104 = Prior           
(-)kbd-1.13/data/keymaps/i386/qwerty/lt.l4.map (-1 lines)
Lines 463-469 Link Here
463
	alt     keycode  99 = Control_backslash
463
	alt     keycode  99 = Control_backslash
464
keycode 100 = AltGr
464
keycode 100 = AltGr
465
keycode 101 = Break #	101=Control-Pause
465
keycode 101 = Break #	101=Control-Pause
466
	control keycode 101 = Control_c
467
string F102 = "\033[7$"
466
string F102 = "\033[7$"
468
keycode 102 = Find  #	=Home
467
keycode 102 = Find  #	=Home
469
	shift	      keycode 102 = F102
468
	shift	      keycode 102 = F102
(-)kbd-1.13/data/keymaps/i386/qwerty/lt.map (-1 lines)
Lines 462-468 Link Here
462
	alt     keycode  99 = Control_backslash
462
	alt     keycode  99 = Control_backslash
463
keycode 100 = AltGr
463
keycode 100 = AltGr
464
keycode 101 = Break #	101=Control-Pause
464
keycode 101 = Break #	101=Control-Pause
465
	control keycode 101 = Control_c
466
string F102 = "\033[7$"
465
string F102 = "\033[7$"
467
keycode 102 = Find  #	=Home
466
keycode 102 = Find  #	=Home
468
	shift	      keycode 102 = F102
467
	shift	      keycode 102 = F102
(-)kbd-1.13/data/keymaps/i386/qwerty/pl2.map (-1 lines)
Lines 242-248 Link Here
242
	alt		keycode 99 = Control_backslash
242
	alt		keycode 99 = Control_backslash
243
keycode 100 = AltGr           
243
keycode 100 = AltGr           
244
keycode 101 = Break           
244
keycode 101 = Break           
245
	control keycode 101 = Control_c
246
keycode 102 = Find            
245
keycode 102 = Find            
247
keycode 103 = Up              
246
keycode 103 = Up              
248
keycode 104 = Prior           
247
keycode 104 = Prior           
(-)kbd-1.13/data/keymaps/i386/qwerty/sk-prog-qwerty.map (-1 lines)
Lines 122-128 Link Here
122
	alt keycode 99 = Control_backslash
122
	alt keycode 99 = Control_backslash
123
keycode 100 = AltGr
123
keycode 100 = AltGr
124
keycode 101 = Break
124
keycode 101 = Break
125
	control keycode 101 = Control_c
126
keycode 102 = Find
125
keycode 102 = Find
127
keycode 103 = Up
126
keycode 103 = Up
128
keycode 104 = Prior
127
keycode 104 = Prior
(-)kbd-1.13/data/keymaps/i386/qwerty/ua.map (-1 lines)
Lines 1515-1521 Link Here
1515
ctrlr keycode 100 = CtrlR_Lock
1515
ctrlr keycode 100 = CtrlR_Lock
1516
ctrll ctrlr keycode 100 = CtrlR_Lock
1516
ctrll ctrlr keycode 100 = CtrlR_Lock
1517
keycode 101 = Break           
1517
keycode 101 = Break           
1518
	control keycode 101 = Control_c
1519
keycode 102 = Find            
1518
keycode 102 = Find            
1520
keycode 103 = Up              
1519
keycode 103 = Up              
1521
keycode 104 = Prior           
1520
keycode 104 = Prior           
(-)kbd-1.13/data/keymaps/i386/qwerty/ua-utf.map (-1 lines)
Lines 1516-1522 Link Here
1516
ctrlr keycode 100 = CtrlR_Lock
1516
ctrlr keycode 100 = CtrlR_Lock
1517
ctrll ctrlr keycode 100 = CtrlR_Lock
1517
ctrll ctrlr keycode 100 = CtrlR_Lock
1518
keycode 101 = Break           
1518
keycode 101 = Break           
1519
	control keycode 101 = Control_c
1520
keycode 102 = Find            
1519
keycode 102 = Find            
1521
keycode 103 = Up              
1520
keycode 103 = Up              
1522
keycode 104 = Prior           
1521
keycode 104 = Prior           
(-)kbd-1.13/data/keymaps/i386/qwerty/ua-utf-ws.map (-1 lines)
Lines 1526-1532 Link Here
1526
ctrlr keycode 100 = CtrlR_Lock
1526
ctrlr keycode 100 = CtrlR_Lock
1527
ctrll ctrlr keycode 100 = CtrlR_Lock
1527
ctrll ctrlr keycode 100 = CtrlR_Lock
1528
keycode 101 = Break           
1528
keycode 101 = Break           
1529
	control keycode 101 = Control_c
1530
keycode 102 = Find            
1529
keycode 102 = Find            
1531
keycode 103 = Up              
1530
keycode 103 = Up              
1532
keycode 104 = Prior           
1531
keycode 104 = Prior           
(-)kbd-1.13/data/keymaps/i386/qwerty/ua-ws.map (-1 lines)
Lines 1521-1527 Link Here
1521
	alt	keycode  99 = Control_backslash
1521
	alt	keycode  99 = Control_backslash
1522
keycode 100 = Alt
1522
keycode 100 = Alt
1523
keycode 101 = Break           
1523
keycode 101 = Break           
1524
	control keycode 101 = Control_c
1525
keycode 102 = Find            
1524
keycode 102 = Find            
1526
keycode 103 = Up              
1525
keycode 103 = Up              
1527
keycode 104 = Prior           
1526
keycode 104 = Prior           
(-)kbd-1.13/data/keymaps/i386/qwerty/us-acentos.map (-1 lines)
Lines 194-200 Link Here
194
	alt	keycode  99 = Control_backslash
194
	alt	keycode  99 = Control_backslash
195
keycode 100 = AltGr           
195
keycode 100 = AltGr           
196
keycode 101 = Break           
196
keycode 101 = Break           
197
	control keycode 101 = Control_c
198
keycode 102 = Find            
197
keycode 102 = Find            
199
keycode 103 = Up              
198
keycode 103 = Up              
200
keycode 104 = Prior           
199
keycode 104 = Prior           
(-)kbd-1.13/data/keymaps/i386/qwertz/cz-us-qwertz.map (-1 lines)
Lines 135-141 Link Here
135
alt keycode 99  = Control_backslash
135
alt keycode 99  = Control_backslash
136
keycode 100  = AltGr
136
keycode 100  = AltGr
137
keycode 101  = Break
137
keycode 101  = Break
138
	control keycode 101 = Control_c
139
keycode 102  = Find
138
keycode 102  = Find
140
keycode 103  = Up
139
keycode 103  = Up
141
keycode 104  = Prior Scroll_Backward Prior Scroll_Backward VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol
140
keycode 104  = Prior Scroll_Backward Prior Scroll_Backward VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol
(-)kbd-1.13/data/keymaps/i386/qwertz/sk-prog-qwertz.map (-1 lines)
Lines 122-128 Link Here
122
	alt keycode 99 = Control_backslash
122
	alt keycode 99 = Control_backslash
123
keycode 100 = AltGr
123
keycode 100 = AltGr
124
keycode 101 = Break
124
keycode 101 = Break
125
	control keycode 101 = Control_c
126
keycode 102 = Find
125
keycode 102 = Find
127
keycode 103 = Up
126
keycode 103 = Up
128
keycode 104 = Prior
127
keycode 104 = Prior
(-)kbd-1.13/data/keymaps/i386/qwertz/sk-qwertz.map (-1 lines)
Lines 123-129 Link Here
123
alt keycode 99 = Control_backslash
123
alt keycode 99 = Control_backslash
124
keycode 100 = AltGr
124
keycode 100 = AltGr
125
keycode 101 = Break
125
keycode 101 = Break
126
	control keycode 101 = Control_c
127
keycode 102 = Find
126
keycode 102 = Find
128
keycode 103 = Up
127
keycode 103 = Up
129
keycode 104 = Prior
128
keycode 104 = Prior
(-)kbd-1.13/man/man8/kbdrate.8 (-3 / +1 lines)
Lines 22-28 Link Here
22
without any options will reset the repeat rate to 10.9 characters per second (cps)
22
without any options will reset the repeat rate to 10.9 characters per second (cps)
23
and the delay to 250 milliseconds (ms) for Intel- and M68K-based systems.
23
and the delay to 250 milliseconds (ms) for Intel- and M68K-based systems.
24
These are the IBM defaults. On SPARC-based systems it will reset the repeat rate
24
These are the IBM defaults. On SPARC-based systems it will reset the repeat rate
25
to 20 cps and the delay to 200 ms.
25
to 5 cps and the delay to 200 ms.
26
26
27
.SH OPTIONS
27
.SH OPTIONS
28
.TP
28
.TP
Lines 69-73 Link Here
69
.I /etc/rc.local
69
.I /etc/rc.local
70
.br
70
.br
71
.I /dev/port
71
.I /dev/port
72
.br
73
.I /dev/kbd
(-)kbd-1.13/src/dumpkeys.c (-17 lines)
Lines 166-175 Link Here
166
	ke.kb_index = 0;
166
	ke.kb_index = 0;
167
	ke.kb_table = 0;
167
	ke.kb_table = 0;
168
	ke.kb_value = K(t, 0);
168
	ke.kb_value = K(t, 0);
169
#if defined(__mc68000__) || defined(__powerpc__)
170
	/* Keycode 0 is a valid keycode, do not clobber it. */
171
	ioctl(fd, KDGKBENT, (unsigned long)&ke);
172
#endif
173
	status = (ioctl(fd, KDSKBENT, (unsigned long)&ke) == 0);
169
	status = (ioctl(fd, KDSKBENT, (unsigned long)&ke) == 0);
174
	return status;
170
	return status;
175
}
171
}
Lines 252-264 Link Here
252
show_short_info(void) {
248
show_short_info(void) {
253
	int i;
249
	int i;
254
250
255
#if !defined(__mc68000__) && !defined(__powerpc__)
256
	printf(_("keycode range supported by kernel:           1 - %d\n"),
251
	printf(_("keycode range supported by kernel:           1 - %d\n"),
257
	       nr_keys - 1);
252
	       nr_keys - 1);
258
#else
259
	printf(_("keycode range supported by kernel:           0 - %d\n"),
260
	       NR_KEYS - 1);
261
#endif
262
	printf(_("max number of actions bindable to a key:         %d\n"),
253
	printf(_("max number of actions bindable to a key:         %d\n"),
263
	       MAX_NR_KEYMAPS);
254
	       MAX_NR_KEYMAPS);
264
	get_keymaps();
255
	get_keymaps();
Lines 370-380 Link Here
370
	for (j = 0; j < MAX_NR_KEYMAPS; j++) {
361
	for (j = 0; j < MAX_NR_KEYMAPS; j++) {
371
	     int ja = (j | M_ALT);
362
	     int ja = (j | M_ALT);
372
	     if (j != ja && keymap_index[j] >= 0 && keymap_index[ja] >= 0)
363
	     if (j != ja && keymap_index[j] >= 0 && keymap_index[ja] >= 0)
373
#if !defined(__mc68000__) && !defined(__powerpc__)
374
		  for (i = 1; i < nr_keys; i++) {
364
		  for (i = 1; i < nr_keys; i++) {
375
#else
376
		  for (i = 0; i < nr_keys; i++) {
377
#endif
378
		       int buf0, buf1, type;
365
		       int buf0, buf1, type;
379
366
380
		       buf0 = get_bind(i, j);
367
		       buf0 = get_bind(i, j);
Lines 402-412 Link Here
402
not_alt_is_meta:
389
not_alt_is_meta:
403
390
404
no_shorthands:
391
no_shorthands:
405
#if !defined(__mc68000__) && !defined(__powerpc__)
406
	for (i = 1; i < nr_keys; i++) {
392
	for (i = 1; i < nr_keys; i++) {
407
#else
408
	for (i = 0; i < nr_keys; i++) {
409
#endif
410
	    for (j = 0; j < keymapnr; j++)
393
	    for (j = 0; j < keymapnr; j++)
411
	      buf[j] = get_bind(i, good_keymap[j]);
394
	      buf[j] = get_bind(i, good_keymap[j]);
412
	    if (buf[0] == -1)
395
	    if (buf[0] == -1)
(-)kbd-1.13/src/kbdrate.c (-38 / +45 lines)
Lines 77-103 Link Here
77
77
78
#ifdef __sparc__
78
#ifdef __sparc__
79
#include <asm/param.h>
79
#include <asm/param.h>
80
#include <asm/kbio.h>
80
#endif
81
#endif
81
82
82
#ifndef KDKBDREP
83
#ifndef KDKBDREP
83
/* usually defined in <linux/kd.h> */
84
/* usually defined in <linux/kd.h> */
84
#define KDKBDREP        0x4B52  /* set keyboard delay/repeat rate;
85
#define KDKBDREP        0x4B52  /* set keyboard delay/repeat rate;
85
				 * actually used values are returned */
86
				 * actually used values are returned */
86
struct kbd_repeat {
87
#endif
88
89
/* Equal to kernel version, but field names vary. */
90
struct my_kbd_repeat {
87
        int delay;        /* in msec; <= 0: don't change */
91
        int delay;        /* in msec; <= 0: don't change */
88
#ifdef __sparc__
89
	int rate;         /* in msec; <= 0: don't change */
90
#else
91
        int period;       /* in msec; <= 0: don't change */
92
        int period;       /* in msec; <= 0: don't change */
92
#endif
93
			  /* earlier this field was misnamed "rate" */
93
};
94
};
94
#endif /* KDKBDREP */
95
96
#ifdef __sparc__
97
#define KBD_PERIOD(var) var.rate
98
#else
99
#define KBD_PERIOD(var) var.period
100
#endif
101
95
102
#include <signal.h>
96
#include <signal.h>
103
97
Lines 115-129 Link Here
115
109
116
static int
110
static int
117
KDKBDREP_ioctl_ok(double rate, int delay, int silent) {
111
KDKBDREP_ioctl_ok(double rate, int delay, int silent) {
118
#if defined(KDKBDREP) && !defined(__sparc__)
112
	/*
119
	/* This ioctl is defined in <linux/kd.h> but is not
113
	 * This ioctl is defined in <linux/kd.h> but is not
120
	   implemented anywhere - must be in some m68k patches.
114
	 * implemented anywhere - must be in some m68k patches.
121
	   We cannot blindly try unimplemented ioctls on sparc64 -
115
	 * Since 2.4.9 also on i386.
122
	   the 32<->64bit transition layer does not like it. */
116
	 */
123
	struct kbd_repeat kbdrep_s;
117
	struct my_kbd_repeat kbdrep_s;
124
118
125
	/* don't change, just test */
119
	/* don't change, just test */
126
	KBD_PERIOD(kbdrep_s) = -1;
120
	kbdrep_s.period = -1;
127
	kbdrep_s.delay = -1;
121
	kbdrep_s.delay = -1;
128
	if (ioctl( 0, KDKBDREP, &kbdrep_s )) {
122
	if (ioctl( 0, KDKBDREP, &kbdrep_s )) {
129
		if (errno == EINVAL || errno == ENOTTY)
123
		if (errno == EINVAL || errno == ENOTTY)
Lines 134-149 Link Here
134
128
135
#if 0
129
#if 0
136
	printf("old delay %d, period %d\n",
130
	printf("old delay %d, period %d\n",
137
	       kbdrep_s.delay, KBD_PERIOD(kbdrep_s));
131
	       kbdrep_s.delay, kbdrep_s.period);
138
#endif
132
#endif
139
133
140
	/* do the change */
134
	/* do the change */
141
	if (rate == 0)				  /* switch repeat off */
135
	if (rate == 0)				  /* switch repeat off */
142
		KBD_PERIOD(kbdrep_s) = 0;
136
		kbdrep_s.period = 0;
143
	else
137
	else
144
		KBD_PERIOD(kbdrep_s)  = 1000.0 / rate; /* convert cps to msec */
138
		kbdrep_s.period  = 1000.0 / rate; /* convert cps to msec */
145
	if (KBD_PERIOD(kbdrep_s) < 1)
139
	if (kbdrep_s.period < 1)
146
		KBD_PERIOD(kbdrep_s) = 1;
140
		kbdrep_s.period = 1;
147
	kbdrep_s.delay = delay;
141
	kbdrep_s.delay = delay;
148
	if (kbdrep_s.delay < 1)
142
	if (kbdrep_s.delay < 1)
149
		kbdrep_s.delay = 1;
143
		kbdrep_s.delay = 1;
Lines 154-172 Link Here
154
	}
148
	}
155
149
156
	/* report */
150
	/* report */
157
	if (KBD_PERIOD(kbdrep_s) == 0)
151
	if (kbdrep_s.period == 0)
152
		rate = 0;
153
	else
154
		rate = 1000.0 / (double) kbdrep_s.period;
155
156
	if (!silent)
157
		printf( _("Typematic Rate set to %.1f cps (delay = %d ms)\n"),
158
			rate, kbdrep_s.delay );
159
160
	kbdrep_s.period = -1;
161
	kbdrep_s.delay = -1;
162
	if (ioctl( 0, KDKBDREP, &kbdrep_s )) {
163
		if (errno == EINVAL)
164
			return 0;
165
		perror( "ioctl(KDKBDREP)" );
166
		exit( 1 );
167
	}
168
	printf("old delay %d, period %d\n",
169
	       kbdrep_s.delay, kbdrep_s.period);
170
	if (kbdrep_s.period == 0)
158
		rate = 0;
171
		rate = 0;
159
	else
172
	else
160
		rate = 1000.0 / (double) KBD_PERIOD(kbdrep_s);
173
		rate = 1000.0 / (double) kbdrep_s.period;
161
174
162
	if (!silent)
175
	if (!silent)
163
		printf( _("Typematic Rate set to %.1f cps (delay = %d ms)\n"),
176
		printf( _("Typematic Rate set to %.1f cps (delay = %d ms)\n"),
164
			rate, kbdrep_s.delay );
177
			rate, kbdrep_s.delay );
165
178
166
	return 1;			/* success! */
179
	return 1;			/* success! */
167
#else /* no KDKBDREP or __sparc__ */
168
	return 0;
169
#endif /* KDKBDREP */
170
}
180
}
171
181
172
static int
182
static int
Lines 181-190 Link Here
181
		exit( 1 );
191
		exit( 1 );
182
	}
192
	}
183
193
184
	KBD_PERIOD(kbdrate_s) = (int) (rate + 0.5);  /* round up */
194
	kbdrate_s.rate = (int) (rate + 0.5);  /* round up */
185
	kbdrate_s.delay = delay * HZ / 1000;  /* convert ms to Hz */
195
	kbdrate_s.delay = delay * HZ / 1000;  /* convert ms to Hz */
186
	if (KBD_PERIOD(kbdrate_s) > 50)
196
	if (kbdrate_s.rate > 50)
187
		KBD_PERIOD(kbdrate_s) = 50;
197
		kbdrate_s.rate = 50;
188
198
189
	if (ioctl( fd, KIOCSRATE, &kbdrate_s )) {
199
	if (ioctl( fd, KIOCSRATE, &kbdrate_s )) {
190
		perror( "ioctl(KIOCSRATE)" );
200
		perror( "ioctl(KIOCSRATE)" );
Lines 194-200 Link Here
194
204
195
	if (!silent)
205
	if (!silent)
196
		printf( "Typematic Rate set to %d cps (delay = %d ms)\n",
206
		printf( "Typematic Rate set to %d cps (delay = %d ms)\n",
197
			KBD_PERIOD(kbdrate_s), kbdrate_s.delay * 1000 / HZ );
207
			kbdrate_s.rate, kbdrate_s.delay * 1000 / HZ );
198
208
199
	return 1;
209
	return 1;
200
#else /* no KIOCSRATE */
210
#else /* no KIOCSRATE */
Lines 211-217 Link Here
211
int
221
int
212
main( int argc, char **argv ) {
222
main( int argc, char **argv ) {
213
#ifdef __sparc__
223
#ifdef __sparc__
214
	double      rate = 20.0;      /* Default rate */
224
	double      rate = 5.0;      /* Default rate */
215
	int         delay = 200;     /* Default delay */
225
	int         delay = 200;     /* Default delay */
216
#else
226
#else
217
	double      rate = 10.9;     /* Default rate */
227
	double      rate = 10.9;     /* Default rate */
Lines 261-269 Link Here
261
		return 0;
271
		return 0;
262
272
263
273
264
	/* The ioport way - will crash on sparc */
274
	/* The ioport way */
265
275
266
#ifndef __sparc__
267
	for (i = 0; i < RATE_COUNT; i++)
276
	for (i = 0; i < RATE_COUNT; i++)
268
		if (rate * 10 >= valid_rates[i]) {
277
		if (rate * 10 >= valid_rates[i]) {
269
			value &= 0x60;
278
			value &= 0x60;
Lines 326-332 Link Here
326
			valid_rates[value & 0x1f] / 10.0,
335
			valid_rates[value & 0x1f] / 10.0,
327
			valid_delays[ (value & 0x60) >> 5 ] );
336
			valid_delays[ (value & 0x60) >> 5 ] );
328
337
329
#endif
330
331
	return 0;
338
	return 0;
332
}
339
}
(-)kbd-1.13/src/setleds.c (+4 lines)
Lines 14-19 Link Here
14
#include "nls.h"
14
#include "nls.h"
15
#include "version.h"
15
#include "version.h"
16
16
17
#ifdef __sparc__
18
#include <asm/kbio.h>
19
#endif
20
17
static void
21
static void
18
usage(void)
22
usage(void)
19
{
23
{

Return to bug 196390