diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-10-24 05:00:29 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-10-24 05:00:29 +0000 |
commit | bdfd0d78bc44e73d693510e70087857785b3b521 (patch) | |
tree | 153a573095afac8d8d0ea857759ecabd77fb28b7 /setkeycodes.c | |
parent | 9260fc5552a3ee52eb95823aa6689d52a1ffd33c (diff) | |
download | busybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.tar.gz busybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.tar.bz2 busybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.zip |
Major rework of the directory structure and the entire build system.
-Erik
Diffstat (limited to 'setkeycodes.c')
-rw-r--r-- | setkeycodes.c | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/setkeycodes.c b/setkeycodes.c deleted file mode 100644 index c3c7e09aa..000000000 --- a/setkeycodes.c +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
2 | /* | ||
3 | * setkeycodes | ||
4 | * | ||
5 | * Copyright (C) 1994-1998 Andries E. Brouwer <aeb@cwi.nl> | ||
6 | * | ||
7 | * Adjusted for BusyBox by Erik Andersen <andersee@debian.org> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
17 | * General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #include <stdio.h> | ||
26 | #include <stdlib.h> | ||
27 | #include <fcntl.h> | ||
28 | #include <sys/ioctl.h> | ||
29 | #include "busybox.h" | ||
30 | |||
31 | |||
32 | /* From <linux/kd.h> */ | ||
33 | struct kbkeycode { | ||
34 | unsigned int scancode, keycode; | ||
35 | }; | ||
36 | static const int KDSETKEYCODE = 0x4B4D; /* write kernel keycode table entry */ | ||
37 | |||
38 | extern int | ||
39 | setkeycodes_main(int argc, char** argv) | ||
40 | { | ||
41 | char *ep; | ||
42 | int fd, sc; | ||
43 | struct kbkeycode a; | ||
44 | |||
45 | if (argc % 2 != 1 || argc < 2) { | ||
46 | show_usage(); | ||
47 | } | ||
48 | |||
49 | fd = get_console_fd("/dev/console"); | ||
50 | |||
51 | while (argc > 2) { | ||
52 | a.keycode = atoi(argv[2]); | ||
53 | a.scancode = sc = strtol(argv[1], &ep, 16); | ||
54 | if (*ep) { | ||
55 | error_msg_and_die("error reading SCANCODE: '%s'", argv[1]); | ||
56 | } | ||
57 | if (a.scancode > 127) { | ||
58 | a.scancode -= 0xe000; | ||
59 | a.scancode += 128; | ||
60 | } | ||
61 | if (a.scancode > 255 || a.keycode > 127) { | ||
62 | error_msg_and_die("SCANCODE or KEYCODE outside bounds"); | ||
63 | } | ||
64 | if (ioctl(fd,KDSETKEYCODE,&a)) { | ||
65 | perror("KDSETKEYCODE"); | ||
66 | error_msg_and_die("failed to set SCANCODE %x to KEYCODE %d", sc, a.keycode); | ||
67 | } | ||
68 | argc -= 2; | ||
69 | argv += 2; | ||
70 | } | ||
71 | return EXIT_SUCCESS; | ||
72 | } | ||