Reassigning Keystrokes on the Atari Portfolio by Carl Koop This files explains how to use the file ANSI.SYS, which can be found either here in the Portfolio SIG or in and DOS 2.0 package, to create 'Hot Keys' so that any DOS command can be entered via a single keystroke or keystroke combination. The information contained in this file is applicable, not only to the Portfolio, but to any DOS with an ANSI.SYS available for it. I hope that you find this information useful and should you have any questions, I can be reached here on CompuServe. The ANSI.SYS file is an enhanced keyboard and display device driver which is available for DOS versions 2 and up. One of the more useful functions of the ANSI.SYS device driver is its ability to reassign values to individual keys on the keyboard. This can be especially useful if you tend to execute the same programs very often as it will enable you to load and start these programs with a single keystroke, similar to loading and starting the Portfolio's editor by pressing the 'Atari' key and the 'E' keys simultaneously. In order to reassign keyboard values you must first install ANSI.SYS into your system just as you would any other installable device driver (be sure to use a DOS 2.0 compatible ANSI.SYS file). This is done by modifying your CONFIG.SYS file so that the driver is installed automatically at boot time. For example, if your ANSI.SYS file is in your C:\DOS directory you simply add the following statement to your CONFIG.SYS file: device=c:\dos\ansi.sys Remember that in order for ANSI.SYS to be installed, and subsequently accessible, you must reboot after adding this line to your CONFIG.SYS file. Also worth remembering is that while installing ANSI.SYS can enhance your usage of your Portfolio, it will also use up some of the already precious, and somewhat limited memory available to you for program execution. Once ANSI.SYS has been installed into your system, you can now reassign standard keystrokes to new values. As is the case with all ANSI.SYS command sequences, reassignment sequences begin with an ESC (escape character) followed by a left bracket ([). The left bracket is followed by the ASCII code of the character of the key that is to be reassigned. This ASCII code is then followed by one or more additional ASCII codes. The key indicated by the first ASCII code will take on the value of the remaining ASCII codes in the command sequence. Each of the ASCII codes must be separated by a semicolon. Finally, the command sequence is terminated by a lower case 'p'. Before we get to an actual example, we must first learn how to enter an escape character into the command sequence since simply hitting the ESC key will not issue the appropriate code (when you do enter an ESC keystroke DOS will intercept it and immediately perform the processing that it feels is appropriate). We will use the DOS command 'PROMPT' to issue the escape sequence as that is the easiest method for our purposes. Now, finally, on to the example. Let's say that you want to be able to load and start a program called 'XTERM2' with a single keystroke, 'F1'. You would issue the following commands at the DOS prompt: prompt $e[0;59;"XTERM2";13p prompt The first line sends the command sequence, in this case the ESC ($e), the left bracket, the ASCII code for F1 (0;59), the additional ASCII characters (we used a shortcut and simply entered a double quoted string), the ASCII code for a carriage return (13) and then terminated the command with a lower case 'p'. The second command resets the prompt to the default. At this point you should be able to press 'F1' and XTERM2 should load and start. Pretty nice, huh? But what do you do if you want to pass a parameter through on the command that starts your program? Well since you probably do not want to set up a keystroke for every possible parameter the best thing to do is eliminate the carriage return (13) from the ANSI.SYS command sequence which will simply display the command to the screen when you press the appropriate keystroke and then enter the parameter manually along with a carriage return. To make this whole operation as simple as possible, you can create a batch file that contains all of the keyboard reassignment commands that you want to have and execute it automatically at boot time. The commands could just as easily be madeOOπςτϞ@ψ@ppρOOOOOςOπςπpόOππ τόp@Ϙπς@4&V76s@9n0[tN l$L--dL.nm,̬΍-- . DL.nm, .L,--ń DLM-Do.n L 0 19@00q9@ 90 0 q