EXOS 2.1 Keyboard Driver Specification

2. Character Input

All input is done using the EXOS read character and read block calls. Read block is supported for compatibility with other devices although it is not very likely to be used. The keyboard is not an output device and so will not accept write character or write block function calls.

With the exception of the function keys which can be programmed with arbitrary strings, each key produces a single ASCII code. Many keys will produce different codes when used in conjunction with the CTRL, SHIFT or ALT keys.


2.1 Lock Modes

The keyboard is always in one of four modes: normal, shift­lock, caps­lock or alt­lock. The default mode is normal. The mode can be changed by various key combinations:

       CTRL LOCK  -  Enters caps-lock mode.
      SHIFT LOCK  -  Enters shift-lock mode.
        ALT LOCK  -  Enters alt-lock mode .
            LOCK  -  Returns to normal mode.

When the keyboard is in any of the lock modes then it behaves as if the appropriate SHIFT, CTRL or ALT key was held down permanenty. If the appropriate key is held down during a lock mode then it temporarily counteracts the effect of the lock. Thus for example in shift­lock mode the action of the SHIFT key is effectively reversed. In this example if the CTRL key is used while in shift­lock modes it will behave as if it was in normal mode. This applies to all other combinations.

The current lock mode is indicated on the status line, the first six characters of which are reserved for the keyboard. It displays "SHIFT", "CAPS" or "ALT" as appropriate and is blank for normal mode.

There is an EXOS variable (LOCK_KEY) which is always set to the current lock status according to the following codes:

0 - Unlocked.
1 - Caps­lock.
2 - Shift­lock.
3 - Alt­lock.

If this EXOS variable is changed by the user then the next keyboard interrupt will update the lock modes appropriately. Any values other than the above which are put into the variable will be changed to one of the four allowed values.


2.2 Key Codes

These are the ASCII codes returned by each key both normally, and with SHIFT, CTRL and ALT (all values are in hexadecimal).

      Key          Normal  SHIFT   CTRL    ALT
      -----------  ------  ------  ------  ------

      1            31      21      31      31
      2            32      22      32      32
      3            33      23      33      33
      4            34      24      34      34
      5            35      25      35      35
      6            36      26      36      36
      7            37      27      37      37
      8            38      28      38      38
      9            39      29      39      39
      0            30      5F      1F      9F

      -            2D      3D      2D      2D
      ^            5E      7E      1E      9E
      @            40      60      00      80
      [            5B      7B      1B      9B
      ;            3B      2B      3B      3B
      :            3A      2A      3A      3A
      ]            5D      7D      1D      9D
      \            5C      7C      1C      9C
      ,            2C      3C      2C      2C
      .            2E      3E      2E      2E
      /            2F      3F      2F      2F
      space        20      20      20      20

      A            61      41      01      81
      B            62      42      02      82
      C            63      43      03      83
      D            64      44      04      84
      E            65      45      05      85
      F            66      46      06      86
      G            67      47      07      87
      H            68      48      08      88
      I            69      49      09      89
      J            6A      4A      0A      8A 
      K            6B      4B      0B      8B
      L            6C      4C      0C      8C 
      M            6D      4D      0D      8D
      N            6E      4E      0E      8E
      O            6F      4F      0F      8F
      P            70      50      10      90
      Q            71      51      11      91
      R            72      52      12      92
      S            73      53      13      93
      T            74      54      14      94
      U            75      55      15      95
      V            76      56      16      96
      W            77      57      17      97
      X            78      58      18      98
      Y            79      59      19      99
      Z            7A      5A      1A      9A

      ENTER        0D      0D      0D      0D
      ESC          1B      1B      1B      1B
      TAB          09      09      09      09

      DEL          A0      A1      A2      A3
      ERASE        A4      A5      A6      A7
      INS          A8      A9      AA      AB
      STOP         03      03      03      03

      JOY UP       B0      B1      B2      B3
      JOY DOWN     B4      B5      B6      B7
      JOY LEFT     B8      B9      BA      BB
      JOY RIGHT    BC      BD      BE      BF

      FUNCTION 1   ..      ..      F0      F8
      FUNCTION 2   ..      ..      F1      F9
      FUNCTION 3   ..      ..      F2      FA
      FUNCTION 4   ..      ..      F3      FB
      FUNCTION 5   ..      ..      F4      FC
      FUNCTION 6   ..      ..      F5      FD
      FUNCTION 7   ..      ..      F6      FE
      FUNCTION 8   ..      ..      F7      FF

Next Chapter: Special Features.



David Bouman. (dsbouma@cs.vu.nl)