'=========================================================================== ' Subject: REMAP KEYBOARD USING ANSI CODES Date: 06-07-97 (00:00) ' Author: Ian Campbell Code: Text ' Origin: dm.campbell@ns.sympatico.ca Packet: FAQS.ABC '=========================================================================== Remapping The Keyboard Using Ansi Codes. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ NOTE: Make sure that ANSI.SYS is loaded in your CONFIG.SYS Ian Campbell bigfeetz@bigfoot.com Ever wanted to remap the keyboard? To customize it to your liking? perhaps even convert it to a Dvorak keyboard for speed? Here's your chance. ANSI codes can be used to tell BIOS how to handle keystrokes. The example below changes the keyboard so that when ever [spacebar] is pressed; - Not actually give a space - Do a dir command - Do a version command - Print "Hello" on the screen ESC[32;27;"dir";13;"ver";13;"rem Hello!";13p In a real ANSI program, the ESC would be replaced with the ASCII symbol for escape. All ANSI codes MUST include ESC (ASCII symbol) and "p" at the end. A breakdown of the above code is as follows. ESC[32;27;"dir";13;"ver";13;"rem Hello!";13pÄÄÄ The end ³ ³ ³ ³ ³ ³ ³ ³ Start ³ ³ ³ ³ ³ ³ Prints hello ³ ³ ³ ³ ³ all dos... ³ ³ ³ ³ Version command ³ ³ ³ Must be put in fron of all dos commands ³ ³ The dir command ³ Cancels the space Shows what key to remap Here is a list of keystrokes and their ANSI equivalent. Code(s) Meaning _______ ______________________________________________ 15 Shift-Tab 16-25 Alt- Q,W,E,R,T,Y,U,I,O,P 30-38 Alt- Z,X,C,V,B,N,M 59-68 F1-F10 71 Home 73 PgUp 79 End 81 PgDn 82 Ins 83 Del 84-93 F11-F20 (Shift- F1-F10) 94-103 F21-F30 (Ctrl- F1-F10) Unfortunately, such ANSI programs can be damaging. It is quite easy to take this knowledge and write malicious programs that damage programs. To protect against such a threat take these simple precautions. - NEVER under any circumstances use type command. This will execute the code! - NEVER use pegasus mail if you are expecting attachments. It will execute all code, malicious or not, and theirs nothing you can do about it because it's external viewer cannot be turned off.