Messages in this thread Patch in this message | | | Date | Sat, 10 Oct 1998 22:00:25 -0700 (PDT) | From | Brion Vibber <> | Subject | [PATCH] Magic SysRq key in Dvorak |
| |
This summer I changed my keyboard layout from QWERTY to Dvorak, and I have been configuring things to work with Dvorak ever since. The console, LILO, X, and even the seldom-used DOS and Windows 95 were fairly easy to do, but I had to hack two things: svgalib (for Quake ;^) and the Linux kernel (for the Magic SysRq key). I think all that's left is the system BIOS, but I'll leave that alone. ;)
For the kernel, I simply added a configuration option for "Dvorak keyboard layout" after "Magic SysRq Key" and then wrapped pckbd_sysrq_xlate[] in an #ifdef block, defining the Dvorak translation table if the option has been selected or the QWERTY table if it has not. If the option is declined, the resulting kernel will be in no way different from a stock kernel.
So I provide here my patch, made against 2.1.125; I've used identical code on 2.1.121 and 2.1.124 previously and have not had any problems with it. I wouldn't mind seeing it in the official kernel but I don't expect it since it is something of a niche product (kernel hackers who use Dvorak... can't be that many of us - or can there?).
You can get my svgalib patch if interested (and some other Dvorak info) at http://pobox.com/~brion/linux/dvorak.php3
-- brion vibber (brion@pobox.com) diff -ur linux-2.1.125-orig/CREDITS linux/CREDITS --- linux-2.1.125-orig/CREDITS Sat Oct 10 19:54:52 1998 +++ linux/CREDITS Sat Oct 10 19:50:27 1998 @@ -1868,6 +1868,11 @@ D: Co-author of German book ``Linux-Kernel-Programmierung'' D: Co-founder of Berlin Linux User Group +N: Brion Vibber +E: brion@pobox.com +W: http://pobox.com/~brion/linux/ +D: Dvorak keymap for Magic SysRq Key + N: Patrick Volkerding E: volkerdi@ftp.cdrom.com D: Produced the Slackware distribution, updated the SVGAlib diff -ur linux-2.1.125-orig/Documentation/Configure.help linux/Documentation/Configure.help --- linux-2.1.125-orig/Documentation/Configure.help Sat Oct 10 19:54:52 1998 +++ linux/Documentation/Configure.help Sat Oct 10 19:33:07 1998 @@ -8618,6 +8618,20 @@ keys are documented in Documentation/sysrq.txt. Don't say Y unless you really know what this hack does. +Dvorak keyboard layout for Magic SysRq Key +CONFIG_DVORAK + The keyboard scancode map used for the Magic SysRq Key is normally + based on the standard US QWERTY layout. If you prefer to use the + Dvorak simplified keyboard layout, say Y here. + + This option affects only the Magic SysRq Key, not the regular + console, X, etc, which should be configured from user space. + + WARNING: If your keyboard is labeled for QWERTY, make sure you can + touch-type in Dvorak! It is very easy to crash your system with the + Magic SysRq Key so you do NOT want to hit the wrong key by mistake. + + ISDN subsystem CONFIG_ISDN ISDN ("Integrated Services Digital Networks", called RNIS in France) diff -ur linux-2.1.125-orig/arch/i386/config.in linux/arch/i386/config.in --- linux-2.1.125-orig/arch/i386/config.in Sat Oct 10 19:54:32 1998 +++ linux/arch/i386/config.in Fri Oct 9 21:36:37 1998 @@ -158,5 +158,8 @@ #bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ +if [ "$CONFIG_MAGIC_SYSRQ" != "n" ]; then + bool 'Dvorak keyboard layout' CONFIG_DVORAK +fi endmenu diff -ur linux-2.1.125-orig/drivers/char/pc_keyb.c linux/drivers/char/pc_keyb.c --- linux-2.1.125-orig/drivers/char/pc_keyb.c Sat Oct 10 19:54:27 1998 +++ linux/drivers/char/pc_keyb.c Fri Oct 9 21:36:37 1998 @@ -33,6 +33,16 @@ /* Simple translation table for the SysRq keys */ #ifdef CONFIG_MAGIC_SYSRQ +#ifdef CONFIG_DVORAK +unsigned char pckbd_sysrq_xlate[128] = + "\000\0331234567890[]\177\t" /* 0x00 - 0x0f */ + "',.pyfgcrl/=\r\000ao" /* 0x10 - 0x1f */ + "euidhtns-`\000\\;qjk" /* 0x20 - 0x2f */ + "xbmwvz\000*\000 \000\201\202\203\204\205" /* 0x30 - 0x3f */ + "\206\207\210\211\212\000\000789-456+1" /* 0x40 - 0x4f */ + "230\177\000\000\213\214\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */ + "\r\000/"; /* 0x60 - 0x6f */ +#else unsigned char pckbd_sysrq_xlate[128] = "\000\0331234567890-=\177\t" /* 0x00 - 0x0f */ "qwertyuiop[]\r\000as" /* 0x10 - 0x1f */ @@ -41,6 +51,7 @@ "\206\207\210\211\212\000\000789-456+1" /* 0x40 - 0x4f */ "230\177\000\000\213\214\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */ "\r\000/"; /* 0x60 - 0x6f */ +#endif #endif unsigned char pckbd_read_mask = KBD_STAT_OBF; /* Modified by psaux.c */ | |