home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / texted / vim / vim300a1 / etc / termcap
Encoding:
Text File  |  1995-03-02  |  6.2 KB  |  166 lines

  1. # Termcap for Acorn vdu drivers.
  2. #
  3. # Radically altered from the standard UnixLib one by Alun Jones.
  4. # Questions to auj@aber.ac.uk
  5. #
  6. # I'll try to explain what the codes do and how to add new modes, 
  7. # since I've had a few enquiries on this front.
  8. #
  9. # A termcap file contains entries for a number of terminal types.
  10. # The entries encode the special character sequences required to achieve
  11. # certain effects on a given terminal. One useful feature is the ability to
  12. # inherit features from one terminal to another.
  13. #
  14. # I have therefore defined a terminal type called acorn_generic, which
  15. # contains default values which should work in all VDU modes. All other
  16. # Acorn terminal types inherit undefined termcap entries from this one.
  17. #
  18. # I'm told that \200 is used to represent NUL characters in termcap
  19. # entries. 
  20. #
  21.  
  22. # The generic acorn terminal driver. It stores a default screen size of
  23. # 80x32 but this is unlikely to be used because UnixLib can read the screen
  24. # size directly.
  25. # The definition has keycodes stored too. Keycodes are a real pain under
  26. # RISC OS because what you receive depends on how you receive it - e.g.
  27. # under a taskwindow many keycodes can be different to what are expected.
  28. # The definition stored here is correct for the keyboard when it has been 
  29. # setup with the following (or equivalent)
  30. # *fx 4 2 0
  31. # *fx 225 192 0
  32. # *fx 226 228 0
  33. # These definitions are the same as those expected by old versions of
  34. # LineEditor and are the definitions used by vim, more and readline, as
  35. # ported by me.
  36. GG|acorn_generic|Acorn Generic VDU driver:\
  37.     :li#32:\
  38.     :co#80:\
  39.     :am:\
  40.     :bs:\
  41.     :bw:\
  42.     :bl=^G:\
  43.     :ce=^W^H^E^F\200\200\200\200\200\200:\
  44.     :cl=^L:\
  45.     :is=^C^F^O^D:\
  46.     :cm=^_%r%.%.:\
  47.     :ho=^^:\
  48.     :le=\010:\
  49.     :cr=\015:\
  50.     :me=^W^Q^E\200\200\200\200\200\200\200:\
  51.     :mr=^W^Q^E\200\200\200\200\200\200\200:\
  52.     :sb=^W^G^A^B\200\200\200\200\200\200:\
  53.     :se=^W^Q^E\200\200\200\200\200\200\200:\
  54.     :sf=^W^G^A^C\200\200\200\200\200\200:\
  55.     :so=^W^Q^E\200\200\200\200\200\200\200:\
  56.     :sr=^W^G^A^B\200\200\200\200\200\200:\
  57.     :up=^K:\
  58.     :vb=^R^C^G^Y^D\200\200\200\200^Ye\200^E\200^D^Ye\200\200\200\200:\
  59.     :vi=^W^A\200\200\200\200\200\200\200\200:\
  60.     :ve=^W^A^A\200\200\200\200\200\200\200:\
  61.     :ku=\317:\
  62.     :kd=\316:\
  63.     :kl=\314:\
  64.     :kr=\315:\
  65.     :kP=\337:\
  66.     :kN=\336:\
  67.     :kh=\036:\
  68.     :kH=\313:\
  69.     :su=\337:\
  70.     :sd=\336:\
  71.     :#4=\334:\
  72.     :%i=\335:\
  73.     :k1=\301:\
  74.     :k2=\302:\
  75.     :k3=\303:\
  76.     :k4=\304:\
  77.     :k5=\305:\
  78.     :k6=\306:\
  79.     :k7=\307:\
  80.     :k8=\310:\
  81.     :k9=\311:\
  82.     :F1=\321:\
  83.     :F2=\322:\
  84.     :F3=\323:\
  85.     :F4=\324:\
  86.     :F5=\325:\
  87.     :F6=\326:\
  88.     :F7=\327:\
  89.     :F8=\330:\
  90.     :F9=\331:\
  91.     :
  92.  
  93. # Right, having got that out of the way, let's have some example terminal
  94. # definitions.
  95. # The first line is a description of the terminal type. It has three parts
  96. # separated by |'s. The first part is always 2 characters long and is not
  97. # used for anything under RISC OS (so far as I know this field is only kept
  98. # for backward compatibility with older Unices). The second part is the
  99. # terminal name. This is the bit which is named in your TERM environment
  100. # variable. The third part is a verbose description.
  101. #
  102. # cl= tells programs how to clear the screen. Since the terminal type is
  103. #     for mode 0, this must contain the octal for codes 22 and 0. Personally
  104. #     I like green screens, so I've followed this up with 19,1,2,0,0,0
  105. #     (remember that 0 is coded as \200).
  106. # is= tells programs how to initialise the terminal. In this case I tell it
  107. #     3,6,22,0,19,1,2,0,0,0. The 3,6 ensures that it's not spooling to
  108. #     printer and vdu output is not disabled.
  109. # tc= tells termcap itself to include all the remaining characteristics from
  110. #     the acorn_generic terminal type.
  111. #    :cl=\026\200\023\001\002\200\200\200:\
  112.  
  113. a0|acorn0|Acorn VDU Driver Mode 0:\
  114.     :cl=^V\200^S^A^B\200\200\200:\
  115.     :is=\003\006\026\200\023\001\002\200\200\200:\
  116.     :tc=acorn_generic
  117.  
  118. # A definition for running in mode 16. This time we have to give a screen
  119. # size since it isn't the default size, a cl which sets mode 16 with green
  120. # text, and a vb (visual bell) which flashes a bigger rectangle on the
  121. # screen. In this example I've used the control-code notation. This is
  122. # equivalent to the octal notation but can be more comprehensible for an
  123. # old BBC hacker like me ;-) (so 19,7,2,0,0,0 is ^S^G^B\200\200\200).
  124. aG|acorn16|Acorn VDU Driver Mode 16:\
  125.     :li#32:co#132:\
  126.     :cl=^V^P^S^G^B\200\200\200:\
  127.     :is=^C^F^V\200^S^G^B\200\200\200:\
  128.     :vb=^R^C^G^Y^D\200\200\200\200^Ye\200^I\200^D^Ye\200\200\200\200:\
  129.     :is=^C^F^V^P^S^A^B\200\200\200:\
  130.     :tc=acorn_generic
  131.  
  132. # What if I want different colours in mode 16 sometimes?
  133. # Well, redefine the cl and is strings to contain the appropriate 
  134. # VDU 19 sequences, then inherit from acorn16.
  135. sk|sick16|Acorn VDU driver Mode 16, revolting colours:\
  136.     :cl=^V\200^S^A^D\200\200\200^S\200^C\200\200\200:\
  137.     :is=^C^F^V\200^S^A^D\200\200\200^S\200^C\200\200\200:\
  138.     :tc=acorn16
  139.  
  140. # So, to add, for example, a multisync mode, you need to create
  141. # a termcap entry, specify its shape, how to start up in that mode
  142. # (both for "cl" and "is" entries), then inherit the generic entry. 
  143. # Here's my guess for mode 21 (Can't test it though :-()
  144. # We can't munge the palette in mode 21, so just stay black and white.
  145. # I suppose you could mess with VDU 17,n to change the foreground colour
  146. # instead.
  147. am|acorn21|Acorn VDU Driver Mode 21:\
  148.     :li#64:co#80:cl=^V^U:is=^C^F^V^U:tc=acorn_generic
  149.  
  150. # Finally this is one for when you are porting stuff and want to know
  151. # just what a program is outputting. It just prints the termcap codes
  152. # rather than expanding them to real vdu operations.
  153. db|debug|For debugging termcap output:\
  154.     :al=[al]^J^M:AL=[AL(%d)]^J^M:ac=[ac]^J^M:ae=[ae]^J^M:as=[as]^J^M:\
  155.     :bl=[bl]^J^M:cd=[cd]^J^M:ce=[ce]^J^M:cl=[cl]^J^M:cm=[cm(%d,%d)]^J^M:\
  156.     :cr=[cr]^J^M:cs=[cs(%d,%d)]^J^M:ct=[ct]^J^M:DC=[DC(%d)]^J^M:\
  157.     :dl=[dl]^J^M:DL=[DL(%d)]^J^M:do=[do]^J^M:DO=[DO(%d)]^J^M:\
  158.     :ds=[ds]^J^M:ei=[ei]^J^M:ho=[ho]^J^M:ic=[ic]^J^M:IC=[IC(%d)]^J^M:\
  159.     :im=[im]^J^M:le=[le]^J^M:LE=[LE(%d)]^J^M:mb=[mb]^J^M:md=[md]^J^M:\
  160.     :me=[me]^J^M:mh=[mh]^J^M:mk=[mk]^J^M:mr=[mr]^J^M:nd=[nd]^J^M:\
  161.     :pc=[pc]^J^M:RA=[RA]^J^M:rc=[rc]^J^M:RI=[RI(%d)]^J^M:SA=[SA]^J^M:\
  162.     :sc=[sc]^J^M:se=[se]^J^M:sf=[sf]^J^M:so=[so]^J^M:sr=[sr]^J^M:\
  163.     :SR=[SR(%d)]^J^M:ta=[ta]^J^M:ue=[ue]^J^M:up=[up]^J^M:UP=[UP(%d)]^J^M:\
  164.     :us=[us]^J^M:vb=[vb]^J^M:ve=[ve]^J^M:vi=[vi]^J^M:vs=[vs]^J^M:\
  165.     :wi=[wi(%d,%d,%d,%d)]^J^M:tc=acorn_generic
  166.