[misc.handicap] replacment keyboard...ANSI

Gene.Zeak@p0.f219.n137.z1.fidonet.org (Gene Zeak) (07/19/90)

Index Number: 9285

ME > ...excuse me for butting in, but another possibility is (if the 
ME > machine will boot DOS) to use the ANSI system for keyboard 
ME > redefinement.  That way, yet another program doesn't have to 

U >   I thought the ANSI keyboard redefination only allows you to change the 
U >one character for each regular key.  KEYFAKE allows you to asign a string or 
U >command to a regular key - in effect makeing them act like Function keys. 

The ANSI system is VERY versatile...even ASCII strings can be 
assigned as key definitions.  One way is to use the PROMPT 
command.  PROMPT gives direct access to ANSI.SYS.

Another, and even better (IMHO), way is to use the TYPE command.  
I use it in my AUTOEXEC.BAT file to redefine a number of 
[Alt-F(key)] combinations.  the command i put into my 
AUTOEXEC.BAT file is: TYPE ANSIKEY.PRG

ANSIKEY.PRG
===========

[0;84;"FLMK";13p
[0;85;"FLUSH";13p
[0;87;"REN ";p
[0;89;"COPY ";p
[0;90;"MDEL ";p
[0;91;"KEYS";13p
[0;92;"PERSONAL";13p
[0;94;"OFF";13p
[0;95;"QD2";13p
[0;96;"PARK";13p
[0;99;"MOVE ";p
[0;100;"DALL";13p
[0;102;"BIZ";13p
[0;104;"FAT";13p
[0;112;"BBS";13p
[0;113;"BACK";13p

The [ combination defines what follows as an ANSI sequence.  The 
number, i.e., 0;94 is the numerical definition of the Ctrl-F1 
key.  The ";" is as ANSI separator.  What follows inside quotes 
(") is the redefinition.  The ";" is a separator.  The "p" 
(small) is the terminator.  The numeral "13 is a directive to 
follow the redefinition (in quotes) with a carriage return.  In 
this case, the entire sequence,{[0;94;"OFF";13p} is an 
instruction to the ANSI system to redefine the Ctrl-F1 key 
combination to type OFF at the command line and follow it with a 
<CR>.  OFF is a batch file that I wore using ANSI to turn my 
screen off.  The last line in it calls the matching batch file, 
ON.BAT which turns my screen back on and re-establishes my 
cursor.

Clear as mud, yet?

OFF.BAT                         ON.BAT
======                          ======

echo off                        echo off
cls                             cls
park                            prompt $e[0m
prompt $e[8m                    prompt $e[4m$d$e[0m$_$p$g
cls
pause > nul
on

**NOTE:  When using the PROMPT command, $e[ gains access to the 
         ANSI system.

In these two batch files, the PROMPT command is used to gain 
access to the ANSI system.

Hope this helps...the ANSI system is grossly underused because 
(IMHO) it is little understood.  The tragedy is that it, and 
batch files can be combined in so many helpful ways that  could 
especially benefit handicapped persons.

Later, Gene...

-- Via Opus Msg Kit v1.11 

--
Uucp: ..!{decvax,oliveb}!bunker!hcap!hnews!137!219.0!Gene.Zeak
Internet: Gene.Zeak@p0.f219.n137.z1.fidonet.org