2 * kbd_mode: report and set keyboard mode - aeb, 940406
4 * If you make \215A\201 an alias for "kbd_mode -a", and you are
5 * in raw mode, then hitting F7 = (two keys) will return you to sanity.
10 #include <linux/types.h>
18 fprintf(stderr, _("usage: kbd_mode [-a|-u|-k|-s]\n"));
23 main(int argc, char *argv[]){
26 set_progname(argv[0]);
28 setlocale(LC_ALL, "");
29 bindtextdomain(PACKAGE, LOCALEDIR);
32 if (argc == 2 && !strcmp(argv[1], "-V"))
33 print_version_and_exit();
39 if (ioctl(fd, KDGKBMODE, &mode)) {
41 fprintf(stderr, _("kbd_mode: error reading keyboard mode\n"));
46 printf(_("The keyboard is in raw (scancode) mode\n"));
49 printf(_("The keyboard is in mediumraw (keycode) mode\n"));
52 printf(_("The keyboard is in the default (ASCII) mode\n"));
55 printf(_("The keyboard is in Unicode (UTF-8) mode\n"));
58 printf(_("The keyboard is in some unknown mode\n"));
64 if (!strcmp(argv[1], "-a"))
66 else if (!strcmp(argv[1], "-u"))
68 else if (!strcmp(argv[1], "-s"))
70 else if (!strcmp(argv[1], "-k"))
74 if (ioctl(fd, KDSKBMODE, mode)) {
76 fprintf(stderr, _("%s: error setting keyboard mode\n"), progname);