Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!agate!helios.ee.lbl.gov!nosc!marlin!jbjones From: jbjones@marlin.NOSC.MIL (John B. Jones) Newsgroups: comp.binaries.ibm.pc.d Subject: Re: Wanted : Clearing files. Summary: Redefining Function Keys Message-ID: <1128@marlin.NOSC.MIL> Date: 15 Feb 89 22:58:18 GMT References: <804@haydn.kulesat.uucp> Reply-To: jbjones@marlin.nosc.mil.UUCP (John B. Jones) Organization: Naval Ocean Systems Center, San Diego Lines: 53 In article <804@haydn.kulesat.uucp> lily@haydn.kulesat.uucp writes: > >Hello, > > ......ection of all answers to possible questions), and under the >multi-user OS Concurrent DOS. > >By the way does anybody know of a way to program the function-keys under >MS-DOS ? > >Thanks in advance. This can be done easily from the command line or in the autoexec.bat by using the phrase prompt $e[{key code};{"statement you want"}[13]p The key code can be the code for ANY key, including shift, control, and alt combinations; the statement you want could also be another key code, to redefine a key you don't use, or a phrase. For instance, let's say you hardly ever use your "a" key, but you find that the phrase "eat at Joe's" is often coming up in your business and personal correspondence. Redefine that baby, with the phrase prompt $e[97;"eat at Joe's";p Or put the phrase at ALT-F1 with prompt $e[0;104;"eat at Joe's"p Or at CTRL-F1 with prompt $e[0;94;"eat at Joe's"p Make an automatic return after the statement by putting a "13" before the p: prompt $e[0;104;"eat at Joe's"13p Most computer nerd books have a list of key codes somewhere in the reference sections; if you don't have such inspired writings, the codes for F1 to F10 are 0;59 through 0;68. HOWEVER...This sort of thing might not work if you are currently using some kind of key redefining TSR(in that case, better do this stuff in the autoexec.bat) and it WON'T work if you don't copy ansi.sys to your home directory (it's on your DOS disks.) The only other "beware" I can think of is that you make sure these commands are coming to the screen; otherwise, try echoing these commands instead of changing the prompt to carry them out. I hope this works for you. Johnjones jbjones@marlin.nosc.mil.UUCP