Z 3 K E Y . R C P A Keyboard Redefinition Program V1.4 MAY 11 1986 Copyright (c) 1985,1986 Arnold L. Bailey Z3KEY.RCP may be used for non-commercial purposes only. No commercial use of Z3KEY.RCP may be made without the author's express written permission.         1.° INTRODUCTION         Z3KEY.RCР ió á ZCPR³ Residenô commanä processoò thaô allowó  thå         useò  tï  assigî characteò stringó tï keys®  Wheî á keù havinç  á         strinç defineä iî thió waù ió struck¬  thå defineä string¬ ratheò         thaî thå characteò normallù associateä witè thå key¬ ió delivereä         tï thå prograí runninç aô thå time.         Unlikå  keù redefinitioî programó foò CP/Í whicè storå  thå  re-         definitioî  prograí jusô belo÷ thå CCÐ anä protecô iô froí á warí         boot¬  Z3KEY.RCÐ ió storeä iî higè memorù anä almosô 4Ë oæ  extrá         TPÁ becomeó available.         Anotheò  advantagå oveò somå otheò Publiã Domaiî programó ió thaô         thå packinç algorithí useä onlù requireó ± bytå oæ overheaä foò á         keù  definition®  Foò examplå re-defininç 'A§ tï 'B§  woulä  onlù         requirå  ³ byteó iî thå keù lookuð table®  Aó keù definitioî  arå         added¬  thå  tablå ió automaticallù compacteä tï minimuí sizå anä         previouó definitionó oæ á giveî keù arå deleted®         Keù  definitionó maù bå loadeä froí fileó  containinç  previouslù         saveä definitions¬  oò theù maù bå defineä on-the-fly¬ eveî whilå         á  prograí ió running®  Botè normaì keyó (i.e®  keyó generatinç á         singlå  character©  anä  keyó  generatinç  escapå  sequenceó  arå         supported® Alsï supporteä arå Supeò Shifô sequenceó foò keyboardó         withouô functioî keys.         Thå maximuí lengtè oæ thå defineä strinç ió thå lengtè oæ thå keù         tablå spacå iî thå RCP® Thå numbeò oæ keyó thaô caî bå re-defineä         ió limiteä onlù bù thå storagå sizå oæ thå table®  Foò examplå iæ         á  Dvoraë  Keyboarä definitioî waó beinç  created¬  eacè  oæ  12¸         differenô  ASCIÉ keyó woulä uså ³ byteó oæ storagå foò á totaì oæ 38´ byteó oæ thå 68° bytå table®  Thió stilì leaveó á loô oæ rooí foò macrï anä Supeò Shifô keù definitions.         2.° OPERATION         Z3KEY.RCÐ V1.´ ió packageä witè thå publiã domaiî ZASÍ assembler.         Alsï thå filå Z3KEY.ZEØ ió includeä tï automaticallù assemblå anä         renamå  thå fileó properly®  Thå onlù filå yoõ havå tï adä ió thå         filå  Z3BASE.LI whicè waó useä tï definå youò versioî oæ  ZCPR3®         Puô thå Z3BASE.LI filå oî thå samå disë aó thå otheò Z3KEÙ fileó Š        and type the command:       ZEX Z3KEY         iæ alì thå fileó arå availablå thå heø filå Z3KEYRCP.HEØ wilì  bå         created¬ loadeä bù MLOAD.COÍ anä renameä tï Z3KEY.RCP® Tï instalì         the newly created RCP type in:         LDR Z3KEY.RCP         Thå Z3KEY.COÍ utilitù ió no÷ selæ installing®  Thå onlù thinç yoõ         havå  tï  determinå  ió  thå addresó oæ  thå  Systeí  Environmenô         Descriptoò  foò  youò  system®  Thió caî bå donå bù  uså  oæ  thå         SHOW.COÍ prograí oò MU3.COM®  MU3.COÍ wilì automaticallù  displaù         the first page of the System Environment Descriptor when run.         To install Z3KEY.COM the first time it is run type the command:         Z3KEÙ HHHÈ {Wherå HHHÈ ió thå addresó oæ thå Environment}          {Descriptor in hexadecimal}         Z3KEY.COÍ  maù  alsï  bå installeä usinç Z3INS.COÍ iî  thå  usuaì         manner.         Z3KEY.RCP contains the following commands:         1® KEY« Turnó oî thå keù redefinitioî program® Thå useò maù no÷          redefine keys as necessary.         2®  KEY- Turnó ofæ thå keù re-definitioî program®  Thió prograí          musô  bå ruî beforå replacinç Z3KEY.RCÐ witè anotheò RCР tï          avoid trashing the BIOS conin and const pointers.         3®  CASE« Turnó oî thå caså translatioî flag® Wheî thió flaç ió          oî  anù  characteò  senô aó parô oæ  á  Leaä  Iî  characteò          sequencå  wilì  bå automaticallù upcased®  Thió ió useä  tï          avoiä caså sensitivå Supeò Shifô sequences®  Foò examplå iæ          '\§ ió useä aó thå Leaä Iî character¬ thå sequencå '\a§ anä          '\A' would be equivalent.         4. CASE- Turns off the case translation flag.         5®  KSTAÔ Displayó whetheò Z3KEÙ ió activå anä thå statuó  oæ          the case flag.         6®  KEYÓ  Displayó  thå presenô keù definitionó á pagå  aô  á          time.         Thå attention/terminatioî characteò ió useä tï gaiî thå attentioî         oæ  Z3KEY.RCР iî ordeò tï enteò á ne÷ keù definition®  Thå  samå         characteò ió useä tï terminatå thå definitioî string®  Thus¬ thió         characteò  shoulä bå onå thaô ió seldoí iæ eveò used¬  botè  froí         thå  keyboard¬  anä  iî keù  definitioî  strings®  Thå  attentioî         character may be output by pressing it twice in a row. Š         Thå lead-iî characteò ió thå firsô characteò generateä bù  keyó         whicè  generatå escapå sequenceó ratheò thaî singlå  characters®         Thió  ió almosô alwayó thå ESCAPÅ characteò (ASCIÉ 2·  decimal)®         Iæ  thå  DELAÙ parameteò ió increaseä iô ió possiblå tï  uså  thå         lead-iî  characteò aó á Supeò Shifô characteò aó describeä below®         Iæ thå DELAÙ parameteò ió seô tï 0¬  thå delaù afteò thå  lead-iî         characteò  becomeó  infinitå anä thå nexô characteò wilì  bå  thå         only one accepted as part of the sequence.         Oncå KEY« haó beeî run¬ strikinç thå attentioî characteò keù wilì         causå Z3KEY.RCÐ tï responä witè thå followinç prompt:         Key:         Strikå  thå  keù  yoõ  wisè tï  define®  Thå  characteò  normallù         generateä  bù thå keù wilì bå displayed¬  followeä bù  aî  equaló         sign®  Supposå  foò example¬  yoõ wisheä tï definå thå  control-Ë         key® Thå followinç woulä appeaò afteò strikinç CTRL-Kº         Keyº ^Ë =         No÷  enteò  thå  definitioî string¬  followeä  bù  thå  attentioî         character®   Supposå  you   wisheä   tï  definå  ^Ë   aó   "MCOPÙ         A0:=B0:*.*^M"®  Thå  followinç woulä bå displayeä jusô beforå you         hiô thå attentioî characteò tï terminatå thå definition:         Keyº ^Ë ½ MCOPY A0:=B0:*.*^M         Afteò entrù oæ thå terminatioî character¬ thå keù definitioî linå         ió  erased®  Notå thaô characteró overwritteî bù  thå  definitioî         linå arå noô rewritten¬ buô replaceä witè spaces.         Aô thió point¬ thå keù haó beeî defined¬ anä strikinç thå defineä         keù  wilì resulô iî thå definitioî strinç beinç delivereä tï  thå         currenô prograí.         Iæ  yoõ  wisè  tï disablå á definitioî jusô definå  thå  keù  aó         itself® Therå ió plentù oæ rooí iî thå tablå foò thió kinä oæ re-         definition. For example Key: ^K = ^K         2.2 Super Shift mode         Thå  Supeò  Shifô modå ió createä bù increasinç  thå  Delaù  timå         usinç  thå  Z3KEY.COÍ utilitù aó describeä  below®  Normallù  thå         delaù  ió  seô sï thaô iô ió jusô lonç enougè tï allo÷  thå  nexô         characteò  senô  bù á functioî keù tï bå receiveä buô timeó  ouô         beforå  anotheò  keù caî bå entereä  manually®  Thió  allowó  thå         prograí  tï  telì  thå  differencå betweeî aî  ESCAPÅ  keù  beinç         presseä  anä  aî  escapå characteò thaô ió  thå  beginninç  oæ  á         function key sequence.         Wheî  thå delaù timå ió increaseä sufficientlù yoõ caî enteò  thå         otheò  characteró  iî  á sequencå manually®  Foò examplå  iæ  yoõ         definå  thå '\§ characteò aó thå lead-iî characteò enterinç  '\p§ Š        coulä  bå  useä  tï generatå 'procedurå '®  Thió  giveó  yoõ  thå         equivalent of a whole keyboard full of function keys.         Jusô  increasinç thå delaù allowó multiplå characteò sequenceó tï         bå entereä afteò á lead-iî characteò aó lonç aó theù arå  entereä         quickly enough.         Settinç  thå  delaù tï ° makeó thå prograí waiô afteò  á  lead-iî         characteò  aó  lonç aó necessarù foò thå  nexô  character®  Sucè         sequenceó  arå alwayó twï characters¬  thå lead-iî characteò  anä         thå  followinç character®  Thió ió similaò tï thå SmartKeù methoä         of Super Shift.         2.3 Z3KEY.COM Utility         Thå  Z3KEY.COÍ utilitù allowó yoõ tï savå definitions¬  re-definå         thå attentioî anä lead-iî characters,seô anä reseô thå caså  flaç         anä seô thå Delaù time.         Iô  ió  writteî iî Turbï Pascaì anä thå sourcå codå ió  included®         Use Z3INS.COM to install the program for your system.         2.3.1 Saving and Loading Key Definitions         Choosinç thå 'S§ Savå optioî wilì prompô foò thå namå tï savå thå         definitioî  to®  Iæ  foò  examplå iæ á numbeò oæ Pascaì  keù  arå         defineä yoõ woulä enteò PASKEÙ aó á possiblå namå tï savå  under®         Thå namå wilì alwayó havå thå extensioî .RCÐ appendeä tï it®  Thå         namå thaô á keù definitioî ió saveä undeò wilì bå inserteä iî thå         filå  anä displayeä wheî KEY« ió ruî tï activateä iô aô  á  lateò         time.         Tï  loaä  á  previouslù saveä keù definitioî uså  thå  ZCPR³  LDÒ         program to load it like any RCP.         2.3.2 Changing the Attention and Lead-In Characters         Choosinç  thå  'A§ foò Attentioî oò 'L§ foò Lead-Iî  optioî  wilì         prompô  foò  á  ne÷  attentioî  oò  lead-iî  character®  Foò  thå         attentioî  characteò uså á verù unlikelù characteò sucè aó ^Ý  oò         ^_.         Foò thå lead-iî characteò uså thå firsô characteò oæ thå functioî         keù  sequenceó  youò  terminaì produces®  Foò  examplå  thå  Wyså         terminaì  useó  ^Á  aó thå firsô characteò oæ it'ó  F±  thrõ  F1¶         characters.         Iæ yoõ wanô tï uså thå Supeò Shifô modå uså anù keù yoõ like® Thå         '\§ is a good choice on most machines.         2.3.3 Changing the Delay Time         Choosinç  thå  'D§ foò Delaù optioî wilì prompô foò á  ne÷  delaù         looð  numbeò  anù  numbeò froí ° tï 32,00° maù  bå  entered®  Foò         normaì functioî keù uså á delaù oæ 20° ió gooä foò mosô machines® Š        Foò  Supeò  Shifô modå á numbeò oæ 100°  ió  usuallù  good®  Thió         numbeò  ió purelù empiricaì sï experimenô tï finä whaô suitó  yoõ         best.         2.3.4 Changing Expansion Rate Count         Choosinç  thå 'R§ foò Expansioî Ratå optioî wilì prompô foò á ne÷         expansioî  ratå  count®  Anù  numbeò betweeî °  anä  25µ  maù  bå         entered® Thå expansioî ratå counô ió thå numbeò oæ timeó thaô thå         ne÷  Consolå  Statuó  routinå  wilì  bå  calleä  beforå  á  macrï         expansioî  characteò wilì bå flaggeä aó available®  Thió preventó         programó  thaô trù tï flusè thå incominç characteró oî  starô  uð         froí  throwinç  awaù parô oæ thå definition®  Turbï pascaì ió  aî         examplå oæ sucè á program®  Iæ á keù ió defineä tï starô uð Turbï         pascaì  aó:          'TURBO^MYE§         anä thå expansioî counô ió seô tï ° thå Ù anä Å wilì bå discardeä         bù  thå program®  Settinç thå expansioî counô tï ² wilì resulô iî         propeò operation.         2.3.5 Compiling definitions from a text file         Choosinç  thå 'F§ optioî wilì prompô foò thå namå oæ á texô  filå         containinç  keù  definitions®  aî  examplå oæ thå  formaô  ió  aó         follows:         ;commentó begiî witè á semicolon         ;thå  keù wordó ATTENTION,LEADIN,DELAY,EXPANSION,FILE¬         ;anä CASÅ seô the correspondinç values® Theù shoulä comå firsô          ;iî thå filå otherwiså they defaulô  tï thå presenô valueó iî         ;Z3KEY.RCP®  Iæ thå CASÅ ió  OÎ thå keyó being         ;defineä wilì bå upcaseä beforå beinç puô iî thå table.         ;         ;Controì characteró arå precedeä bù á '^'®          ;Iæ yoõ wanô tï enteò á '^§ in á  definitioî  uså  aî         ;imbeddeä controlÞ  instead®  Iô  wilì  bå converteä tï á '^'         ;bù thå compiler.         ATTENTION=^]         LEADIN=\         DELAY=0         EXPANSION=2         FILE=PASKEY         CASE=off         \w=write(         \W=writeln(         \r=read(         \R=readln(         \a=At(         \^_=caraô underline         ^M=^M         \p=procedurå         \f=functioî Š        =caret         \t=turbo^MY         \b=begin^Mend;^A^A^M         \u=repeat^muntiì ;^h         \P=prograí         This example is included in the library as TEST.DEF.         2.3.6 Displaying key definitions.         Choosinç  thå 'K§ optioî wilì displaù thå presentlù defineä  lisô         of definitions in Z3KEY.RCP,         2.4 Disabling Z3KEY         Enterinç  KEY- from á thå commanä linå wilì disablå thå Z3KEY.RCP®         Iô wilì stilì bå installeä anä maù bå reactivateä aô anù timå  bù         enterinç KEY« ® KEY- musô bå ruî beforå loadinç á ne÷ RCÐ becauså         thå  BIOÓ  jumð tablå haó beeî patcheä tï intercepô  anù  consolå         calls®  Iæ  yoõ jusô loaä thå ne÷ RCÐ thå bioó wilì noô finä  thå         proper code and the system will crash, guaranteed. 3.0 ADVANCED TOPICS          3.± Creatinç Definitionó Containinç Non-keyboarä Characters         Definitionó maù bå createä containinç characteró noô generateä bù         anù keù oî thå computer'ó keyboarä througè direcô modificatioî oæ         thå keù definitioî file(s)® Thió mighô bå usefuì tï adä á DELETÅ         keù tï á computeò havinç onlù á BACKSPACÅ key¬ foò example.         Iî  ordeò  tï dï this¬  thå structurå oæ thå keù definitioî  filå         musô  bå  understood®  Á  keù definitioî filå  consistó  oæ  nulì         delimiteä logicaì recordó oæ thå keù characteró tï bå  redefineä         followeä  bù  thå  definitioî strinç anä terminateä  bù  á  nulì         character®  Thå beginninç oæ thå tablå ió markeä bù thå attentioî         characteò  followeä bù ² leadiî characteró followeä bù á  0®  Thå         duaì  lead-iî  characteò  serveó  tï  definå  á  singlå   lead-iî         characteò  aó á singlå lead-iî character®  Eacè oæ thå  followinç         definitions looks as follows.         [\pprocedure]°  whicè defineó '\p§ aó procedurå wherå '\§ ió  thå          leadin character.         Thå followinç ió aî examplå oæ thå sequencå oæ characteró useä tï         definå  CTRL-Ä  tï bå DELETE¬  assuminç thå keyboarä  beinç  useä         cannoô generatå thå DELETÅ character®         In assembler:          Š         DB 04,07FH,0         Versioî  1.²  anä laterº          Thå abovå explanatioî ió modifieä aó follows.         Iæ  thå  KEYDEÆ  variablå ió seô tï truå  iî  Z3KEYRCP.LI  whicè         enableó  thå KEYÓ displaù option¬  thå translatioî portioî oæ thå         tablå musô havå thå higè biô seô foò eacè oæ thå characters® Thió         ió sï thå routinå caî telì thå translatioî froí thå originaì  keù         portioî  oæ thå totaì definition®  Thå deletå portioî abovå woulä         be modified like so:          DB 04,0FFH,0 to define ^D as DELETE