*****************************  MODULE HEADER  *******************************
*                                                                           *
*                                                                           *
*  MACHINE:                LANGUAGE:                        OS: CTOS        *
*                                                                           *
*  21.kbd_data                                                              *
*                                                                           *
*     This file contains the text version of the table that causes a K2     *
*     keyboard to emulate a K1 keyboard for the OS version of NlsKbd.sys. *
*                                                                           *
*                                                                           *
*  HISTORY:                                                                 *
*                                                                   *
*                                                                           *
*  MMDDYY VVVVMM  PROGRAMMER      DESCRIPTION                           *
*                                                                           *
*  032092 122G.01  V. Miller       Added comments documenting how the    *
*                                     emulated LEDs table should work.      *
*                    V. Miller  K. Hampton      Created.                  *
*                                                                           *
*                    PROPRIETARY  PROGRAM  MATERIAL                         *
*                                                                           *
*  THIS MATERIAL IS PROPRIETARY TO UNISYS CORPORATION AND IS NOT TO         *
*  BE REPRODUCED, USED OR DISCLOSED EXCEPT IN ACCORDANCE WITH PROGRAM       *
*  LICENSE OR UPON WRITTEN AUTHORIZATION OF THE PATENT DIVISION OF          *
*  UNISYS CORPORATION, DETROIT, MICHIGAN 48232, USA.                        *
*                                                                           *
*  COPYRIGHT (C) 1990 UNISYS CORPORATION. ALL RIGHTS RESERVED               *
*                                                                           *
*****************************************************************************
*                                                                           *
*  UNISYS BELIEVES THAT THE SOFTWARE FURNISHED HEREWITH IS ACCURATE         *
*  AND RELIABLE, AND MUCH CARE HAS BEEN TAKEN IN ITS PREPARATION. HOWEVER,  *
*  NO RESPONSIBILITY, FINANCIAL OR OTHERWISE, CAN BE ACCEPTED FOR ANY       *
*  CONSEQUENCES ARISING OUT OF THE USE OF THIS MATERIAL, INCLUDING LOSS     *
*  OF PROFIT, INDIRECT, SPECIAL, OR CONSEQUENTIAL DAMAGES, THERE ARE NO     *
*  WARRANTIES WHICH EXTEND BEYOND THE PROGRAM SPECIFICATION.                *
*                                                                           *
*  THE CUSTOMER SHOULD EXERCISE CARE TO ASSURE THAT USE OF THE SOFTWARE     *
*  WILL BE IN FULL COMPLIANCE WITH LAWS, RULES AND REGULATIONS OF THE       *
*  JURISDICTIONS WITH RESPECT TO WHICH IT IS USED.                          *
*                                                                           *
**************************  END OF MODULE HEADER  ***************************

;
;     This is the data file for the K2 Keyboard that is used by the Create
;     Keyboard Table Application.  The format is translation tables for a
;     K1 keyboard followed by emulation tables that convert K2 iKeys to the
;     K1 iKey values that produce the same effect.
;
;     In what follows semicolons, ;, or the slashasterix pair * start
;     comments.  The newline character ends comments.  Also lines consisting
;     of only the new line character are ignored.

; Keyboard name
 K2

; Output file name
 K2KbdTables.obj

; Name of PUBLIC in object module at start of table
 K2KeyBoardData


;Number of forms files needed to display keyboard.
 0


;  ====================================================================
;  ====================================================================
;
;                           EMULATION DATA
;
;  What follows is the data that enables the keyboard process to emulate
;  the K2 keyboard as a K1 keyboard.  This means that K2 statehardware iKey
;  combinations are replaced by the statehardware iKey for the K1 keyboard
;  that give the same result.
;


EMULATION DATA EXISTS         ; The preceeding string is NOT a comment.  It
                              ;      must be in the file if emulation data
                              ;      is present in the file.


START SPECIAL KEYS            ; The preceeding string is NOT a comment.  It
                              ;      must be in the file even if no special
                              ;      keys list is included.


;
;  : Number of entries in per key tables in hex
;  |
;  |    : IBus ID in hex.
;  |    |
;  |    |    : Key up mask in hex.
;  |    |    |
;  |    |    |   :  Number of emulation tables in hex
;  |    |    |   |
;  |    |    |   |     :  Target translation table in hex
;  |    |    |   |     |
;
  80   FF   80   2    04


;
; Special keys.
; 
; The first column is the hardware iKey returned by the special key (in
; hex).  The second column (the comments) is the value of that key on the
; K1 keyboard.  For example the delete key returns 7F h.  For the K1
; keyboard this data is in Tables B1 or C1 in the CTOS Concepts manual.
; This table MUST have at least 22  and at most 29 entries and they MUST
; be in the order shown.

22   ; Number special keys

61   ;   a
62   ;   b
7F   ;   <DELETE>
44   ;   <OVERTYPE>
4C   ;   <LEFT CODE>
4D   ;   <RIGHT CODE>
04   ;   <FINISH>
43   ;   <ACTION>
45   ;   <LOCK>
48   ;   <LEFT SHIFT>
49   ;   <RIGHT SHIFT>
64   ;   Mouse Disable <RESERVED FOR Bull>
65   ;   Mouse Enable  <RESERVED FOR Bull>
40   ;   <ALT>
00   ;    c
1B   ;   <GO>
40   ;   iKey not valid
20   ;   Diacritic Escape
00   ;   Sys Key
00	 ;	 OS1
00	 ;	 OS2
00	 ;	 OS3

END SPECIAL KEYS              ; The preceeding string is NOT a comment.  It
                              ;      must be in the file even if no special
                              ;      keys list is included.



START LED EMULATION DATA      ; The preceeding string is NOT a comment.  It
                              ;      must be in the file even if no list of
                              ;      default chords is included.


;  If the ith entry in this table is nonzero (say it isj instead),
;  it means that when the user of the actual keyboard asks for the
;  ith LED to be turned on the jth LED is turned on instead.
;

    8     ; Number of LEDs on keyboard (NOT number of entries in table).  This
          ;      number must be 16 or less.


; The table below is used to specify what LED is turned on when a key that
;     affects an LED is pressed.  The table MUST have 16 entries.


;  Enter the number of the LED to be actually be turned on when the code
;       specifies the particular LED number.  For example,  the entry
;
;            03   ; 7
;
;       means that when an application specifies that LED 7 be turned on,
;       actually turn on LED 03 (where both 3 and 7 are base 10).
;
;  Other possible values
;
;    0 means don't remap (or map to itself).  For example,  the entry
;
;            00   ; 8
;
;         means thet when an application specifies that LED 8 be turned on,
;         don't change (or remap) what is to be turned on; actually turn on
;         LED 08.
;
;    FF (or actually any number greater than 16) means not supported.
;         For example,  the entry
;
;            FF   ; 9
;
;         means thet when an application specifies that LED 9 be turned on,
;         nothing is turned on.
;
;  When we say LED x is set, we mean that the current LED state is ORed
;       with the xth entry in the following array.
;
;       1h,2h,4h,8h,10h,20h,40h,80h
;
;       LEDs >8 on the Kx style keyboards are handled according to the
;       rquirement described in the hardware spec.
;

    00   ;       1            f10
    00   ;       2            f9
    00   ;       3            f8
    00   ;       4            f3 
    00   ;       5            f2
    00   ;       6            f1
    00   ;       7           LOCK
    00   ;       8         Overtype
    00   ;       9           Comm1        Not used on this keyboard
    00   ;      10           Comm2        Not used on this keyboard
    00   ;      11           Comm3        Not used on this keyboard
    00   ;      12           Comm4        Not used on this keyboard
    00   ;      13           Comm5        Not used on this keyboard
    00   ;      14         'Numlock'      Not used on this keyboard
    00   ;      15       'Scroll Lock'    Not used on this keyboard
    00   ;      16                        Not used on this keyboard

END LED EMULATION DATA        ; The preceeding string is NOT a comment.  It
                              ;      must be in the file even if no special
                              ;      keys list is included.


START CHORDS KEYS             ; The preceeding string is NOT a comment.  It
                              ;      must be in the file even if no list of
                              ;      default chords is included.

;
; Default Chords for a translation table.
;
;

5    ;   Number of entries

;
;    ALL NUMBERS IN THE FOLLOWING TABLE MUST BE IN HEX
;
;  key     bMask*  fToggle fLed  LED mask** 
; number    bit                    bit      fExclus
;         position               position    ionary
; (hex)     (hex)                  (hex)
; 

    48        0       F      F      0          F   ;  Chord 1   <LEFT SHIFT>
    49        1       F      F      0          F   ;  Chord 2   <RIGHT SHIFT>
    4C        2       F      F      0          F   ;  Chord 3   <RIGHT CODE>
    4D        3       F      F      0          F   ;  Chord 4   <LEFT CODE>
    45        4       T      T      6          F   ;  Chord 5   <LOCK>

END CHORDS KEYS                     ; The preceeding string is NOT a comment.
                                    ;      It must be in the file even if no
                                    ;      list of default chords is included.


START ALLOWED STATES TABLE          ; The preceeding string is NOT a comment.
                                    ;      It must be in the file even if no
                                    ;      repeat attributes table is included.


;                       ENTRIES
; 
; Chords that affect       iKey   Key
;    this iKey          Number  Name
; numbers are decimal
;         

    { 1,2 }              ; 00
    { 1,2 }              ; 01
    { 1,2 }              ; 02
    { 1,2 }              ; 03
    { 1,2 }              ; 04
    { 1,2 }              ; 05
    { 1,2 }              ; 06
    { 1,2 }              ; 07
    { 1,2 }              ; 08
    { 1,2 }              ; 09
    { 1,2 }              ; 0A
    { 1,2 }              ; 0B
    { 1,2 }              ; 0C
    { 1,2 }              ; 0D
    { 1,2 }              ; 0E
    { 1,2 }              ; 0F
    { 1,2 }              ; 10
    { 1,2 }              ; 11
    { 1,2 }              ; 12
    { 1,2 }              ; 13
    { 1,2 }              ; 14
    { 1,2 }              ; 15
    { 1,2 }              ; 16
    { 1,2 }              ; 17
    { 1,2 }              ; 18
    { 1,2 }              ; 19
    { 1,2 }              ; 1A
    { 1,2 }              ; 1B
    { 1,2 }              ; 1C
    { 1,2 }              ; 1D
    { 1,2 }              ; 1E
    { 1,2 }              ; 1F
    { 1,2 }              ; 20
    { 1,2 }              ; 21
    { 1,2 }              ; 22
    { 1,2 }              ; 23
    { 1,2 }              ; 24
    { 1,2 }              ; 25
    { 1,2 }              ; 26
    { 1,2 }              ; 27
    { 1,2 }              ; 28
    { 1,2 }              ; 29
    { 1,2 }              ; 2A
    { 1,2 }              ; 2B
    { 1,2 }              ; 2C
    { 1,2 }              ; 2D
    { 1,2 }              ; 2E
    { 1,2 }              ; 2F
    { 1,2 }              ; 30
    { 1,2 }              ; 31
    { 1,2 }              ; 32
    { 1,2 }              ; 33
    { 1,2 }              ; 34
    { 1,2 }              ; 35
    { 1,2 }              ; 36
    { 1,2 }              ; 37
    { 1,2 }              ; 38
    { 1,2 }              ; 39
    { 1,2 }              ; 3A
    { 1,2 }              ; 3B
    { 1,2 }              ; 3C
    { 1,2 }              ; 3D
    { 1,2 }              ; 3E
     { 0 }               ; 3F
     { 0 }               ; 40
    { 1,2 }              ; 41
    { 1,2 }              ; 42
     { 0 }               ; 43
    { 1,2 }              ; 44
     { 5 }               ; 45
    { 1,2 }              ; 46
    { 1,2 }              ; 47
     { 1 }               ; 48
     { 2 }               ; 49
    { 1,2 }              ; 4A
    { 1,2 }              ; 4B
     { 3 }               ; 4C
     { 4 }               ; 4D
     { 0 }               ; 4E
     { 0 }               ; 4F
     { 0 }               ; 50
     { 0 }               ; 51
     { 0 }               ; 52
     { 0 }               ; 53
    { 1,2 }              ; 54
     { 0 }               ; 55
     { 0 }               ; 56
     { 0 }               ; 57
     { 0 }               ; 58
    { 1,2 }              ; 59
     { 0 }               ; 5A
    { 1,2 }              ; 5B
    { 1,2 }              ; 5C
    { 1,2 }              ; 5D
    { 1,2 }              ; 5E
     { 0 }               ; 5F
    { 1,2 }              ; 60
   { 1,2,5 }             ; 61
   { 1,2,5 }             ; 62
   { 1,2,5 }             ; 63
   { 1,2,5 }             ; 64
   { 1,2,5 }             ; 65
   { 1,2,5 }             ; 66
   { 1,2,5 }             ; 67
   { 1,2,5 }             ; 68
   { 1,2,5 }             ; 69
   { 1,2,5 }             ; 6A
   { 1,2,5 }             ; 6B
   { 1,2,5 }             ; 6C
   { 1,2,5 }             ; 6D
   { 1,2,5 }             ; 6E
   { 1,2,5 }             ; 6F
   { 1,2,5 }             ; 70
   { 1,2,5 }             ; 71
   { 1,2,5 }             ; 72
   { 1,2,5 }             ; 73
   { 1,2,5 }             ; 74
   { 1,2,5 }             ; 75
   { 1,2,5 }             ; 76
   { 1,2,5 }             ; 77
   { 1,2,5 }             ; 78
   { 1,2,5 }             ; 79
   { 1,2,5 }             ; 7A
    { 1,2 }              ; 7B
    { 1,2 }              ; 7C
    { 1,2 }              ; 7D
     { 0 }               ; 7E
    { 1,2 }              ; 7F

END ALLOWED STATES TABLE            ; The preceeding string is NOT a comment.
                                    ;      It must be in the file even if no
                                    ;      repeat attributes table is included.

START CONDITIONS                    ; The preceeding string is NOT a comment.
                                    ;      It must be in the file even if no
                                    ;      translation table are included.

;
; Default Conditions info

 2  ; Number of conditions

; Conditions that point to a given table
;
; NOTE: Numbers in orStates are decimal
;
; Table         Conditions               Comments
;  ID   
;       orState1  orState2  orState3
;          

    0   {       }   { 0 }      { 0 }    ; No chord keys down
    1   { 1,2,5 }                       ; Shiftlock OR either Shift key down;
                                        ;       one orState

END CONDITIONS                      ; The preceeding string is NOT a comment.
                                    ;      It must be in the file even if no
                                    ;      translation table are included.


START MULTIBYTES                    ; The preceeding string is NOT a comment.
                                    ;      It must be in the file even if no
                                    ;      translation multi byte strings are
                                    ;      included.

;
; Default Multibyte Tables

1    ; Number of multibyte strings

; String

    { 00:30, 00:B0, 00:30, 00:B0 }

END MULTIBYTES                      ; The preceeding string is NOT a comment.
                                    ;      It must be in the file even if no
                                    ;      translation multi byte strings are
                                    ;      included.

START DIACRITICS                    ; The preceeding string is NOT a comment.
                                    ;      It must be in the file even if no
                                    ;      translation diacritics are included.

;
; Default Diacritic Tables

0  ; Number of diacritic pairs


END DIACRITICS                      ; The preceeding string is NOT a comment.
                                    ;      It must be in the file even if no
                                    ;      translation diacritics are included.

START TABLES                        ; The preceeding string is NOT a comment.
                                    ;      It must be in the file even if no
                                    ;      translation table are included.

;
; Default Emulation Tables Info

; Number of emulation tables specified in special keys section.

;
;   Table for case where no chord keys held down.
;
;   NOTE: FFFF:xx means use existing state.
;

;
;   Table 0, for case where no chord keys held down.
;

         FFFF:00            ;  00
         FFFF:01            ;  01
         FFFF:02            ;  02
         FFFF:03            ;  03
         FFFF:04            ;  04
         FFFF:05            ;  05
         FFFF:06            ;  06
         FFFF:07            ;  07
         FFFF:08            ;  08
         FFFF:09            ;  09
         FFFF:0A            ;  0A
         FFFF:0B            ;  0B
         FFFF:0C            ;  0C
         FFFF:0D            ;  0D
         FFFF:0E            ;  0E
         FFFF:0F            ;  0F
         FFFF:10            ;  10
         FFFF:11            ;  11
         FFFF:12            ;  12
         FFFF:13            ;  13
         FFFF:14            ;  14
         FFFF:15            ;  15
         FFFF:16            ;  16
         FFFF:17            ;  17
         FFFF:18            ;  18
         FFFF:19            ;  19
         FFFF:1A            ;  1A
         FFFF:1B            ;  1B
         FFFF:1C            ;  1C
         FFFF:1D            ;  1D
         FFFF:1E            ;  1E
         FFFF:1F            ;  1F
         FFFF:20            ;  20
         FFFF:21            ;  21
         FFFF:22            ;  22
           08:04            ;  23
                            ;            Replace K2 value (unshifted 24) with
           01:38            ;  24  >>>>  K1 value (<SHIFT> 38) because asterix
                            ;            is also on this key on the K2
                            ;            keyboard.
         FFFF:2F            ;  25
         FFFF:26            ;  26
         FFFF:27            ;  27
         FFFF:28            ;  28
         FFFF:29            ;  29
         FFFF:2A            ;  2A
         FFFF:2B            ;  2B
         FFFF:2C            ;  2C
         FFFF:2D            ;  2D
         FFFF:2E            ;  2E
         FFFF:2F            ;  2F
         FFFF:30            ;  30
         FFFF:31            ;  31
         FFFF:32            ;  32
         FFFF:33            ;  33
         FFFF:34            ;  34
         FFFF:35            ;  35
         FFFF:36            ;  36
         FFFF:37            ;  37
         FFFF:38            ;  38
         FFFF:39            ;  39
         FFFF:2B            ;  3A
         FFFF:3B            ;  3B
         FFFF:3C            ;  3C
         FFFF:3D            ;  3D
           01:35            ;  3E
         FFFF:FF            ;  3F
         FFFF:FF            ;  40
         FFFF:41            ;  41
         FFFF:42            ;  42
         FFFF:43            ;  43
         FFFF:44            ;  44
         FFFF:45            ;  45
         FFFF:46            ;  46
         FFFF:47            ;  47
         FFFF:48            ;  48
         FFFF:49            ;  49
         FFFF:4A            ;  4A
         FFFF:4B            ;  4B
         FFFF:4C            ;  4C
         FFFF:4D            ;  4D
         FFFF:FF            ;  4E
         FFFF:FF            ;  4F
         FFFF:FF            ;  50
         FFFF:FF            ;  51
         FFFF:FF            ;  52   Since there is no <SYS> key on K2 keyboard
         FFFF:FF            ;  53   Since there is no <ALT> key on K2 keyboard
           01:2B            ;  54
         FFFF:FF            ;  55
         FFFF:FF            ;  56
         FFFF:FF            ;  57
         FFFF:58            ;  58
        SM:01:4A            ; 059    Numeric 00   MUST BE MULTIBYTE
         FFFF:FF            ;  5A
         FFFF:5B            ;  5B
         FFFF:5C            ;  5C
         FFFF:5D            ;  5D
         FFFF:FF            ;  5E
         FFFF:FF            ;  5F
         FFFF:60            ;  60
         FFFF:61            ;  61
         FFFF:62            ;  62
         FFFF:63            ;  63
         FFFF:64            ;  64
         FFFF:65            ;  65
         FFFF:66            ;  66
         FFFF:67            ;  67
         FFFF:68            ;  68
         FFFF:69            ;  69
         FFFF:6A            ;  6A
         FFFF:6B            ;  6B
         FFFF:6C            ;  6C
         FFFF:6D            ;  6D
         FFFF:6E            ;  6E
         FFFF:6F            ;  6F
         FFFF:70            ;  70
         FFFF:71            ;  71
         FFFF:72            ;  72
         FFFF:73            ;  73
         FFFF:74            ;  74
         FFFF:75            ;  75
         FFFF:76            ;  76
         FFFF:77            ;  77
         FFFF:78            ;  78
         FFFF:79            ;  79
         FFFF:7A            ;  7A
         FFFF:7B            ;  7B
         FFFF:7C            ;  7C
         FFFF:7D            ;  7D
         FFFF:FF            ;  7E
         FFFF:7F            ;  7F



;
;   Table 1, for case where <SHIFT> or <LOCK> key held down.
;

         FFFF:00            ;  00
         FFFF:01            ;  01
         FFFF:02            ;  02
         FFFF:03            ;  03
         FFFF:04            ;  04
         FFFF:05            ;  05
         FFFF:06            ;  06
         FFFF:07            ;  07
         FFFF:08            ;  08
         FFFF:09            ;  09
         FFFF:0A            ;  0A
         FFFF:0B            ;  0B
         FFFF:0C            ;  0C
         FFFF:0D            ;  0D
         FFFF:0E            ;  0E
         FFFF:0F            ;  0F
         FFFF:10            ;  10
         FFFF:11            ;  11
         FFFF:12            ;  12
         FFFF:13            ;  13
         FFFF:14            ;  14
         FFFF:15            ;  15
         FFFF:16            ;  16
         FFFF:17            ;  17
         FFFF:18            ;  18
         FFFF:19            ;  19
         FFFF:1A            ;  1A
         FFFF:1B            ;  1B
         FFFF:1C            ;  1C
         FFFF:1D            ;  1D
         FFFF:1E            ;  1E
         FFFF:1F            ;  1F
         FFFF:20            ;  20
           00:5E            ;  21    caret     (from 9 pad key)
         FFFF:22            ;  22
           08:05            ;  23
         FFFF:38            ;  24
           00:2F            ;  25
         FFFF:26            ;  26
         FFFF:27            ;  27
         FFFF:28            ;  28
         FFFF:29            ;  29
         FFFF:2A            ;  2A
         FFFF:2B            ;  2B
         FFFF:2C            ;  2C
         FFFF:2D            ;  2D
         FFFF:2E            ;  2E
         FFFF:2F            ;  2F
         FFFF:30            ;  30
         FFFF:31            ;  31
         FFFF:32            ;  32
         FFFF:33            ;  33
         FFFF:34            ;  34
         FFFF:35            ;  35
         FFFF:36            ;  36
         FFFF:37            ;  37
         FFFF:38            ;  38
         FFFF:39            ;  39
           00:2B            ;  3A
         FFFF:3B            ;  3B
         FFFF:3C            ;  3C
         FFFF:3D            ;  3D
         FFFF:35            ;  3E
         FFFF:FF            ;  3F
         FFFF:FF            ;  40
         FFFF:5E            ;  41
         FFFF:42            ;  42
         FFFF:43            ;  43
         FFFF:44            ;  44
         FFFF:45            ;  45
           00:06            ;  46
         FFFF:06            ;  47
         FFFF:48            ;  48
         FFFF:49            ;  49
         FFFF:4A            ;  4A
         FFFF:4B            ;  4B
         FFFF:4C            ;  4C
         FFFF:4D            ;  4D
         FFFF:FF            ;  4E
         FFFF:FF            ;  4F
         FFFF:FF            ;  50
         FFFF:FF            ;  51
         FFFF:FF            ;  52
         FFFF:FF            ;  53
         FFFF:2B            ;  54
         FFFF:FF            ;  55
         FFFF:FF            ;  56
         FFFF:FF            ;  57
         FFFF:58            ;  58
        SM:01:4A            ; 059    Numeric 00   
         FFFF:FF            ;  5A
         FFFF:5B            ;  5B
         FFFF:5C            ;  5C
         FFFF:5D            ;  5D
         FFFF:FF            ;  5E
         FFFF:FF            ;  5F
         FFFF:60            ;  60
         FFFF:61            ;  61
         FFFF:62            ;  62
         FFFF:63            ;  63
         FFFF:64            ;  64
         FFFF:65            ;  65
         FFFF:66            ;  66
         FFFF:67            ;  67
         FFFF:68            ;  68
         FFFF:69            ;  69
         FFFF:6A            ;  6A
         FFFF:6B            ;  6B
         FFFF:6C            ;  6C
         FFFF:6D            ;  6D
         FFFF:6E            ;  6E
         FFFF:6F            ;  6F
         FFFF:70            ;  70
         FFFF:71            ;  71
         FFFF:72            ;  72
         FFFF:73            ;  73
         FFFF:74            ;  74
         FFFF:75            ;  75
         FFFF:76            ;  76
         FFFF:77            ;  77
         FFFF:78            ;  78
         FFFF:79            ;  79
         FFFF:7A            ;  7A
         FFFF:7B            ;  7B
         FFFF:7C            ;  7C
         FFFF:7D            ;  7D
         FFFF:FF            ;  7E
         FFFF:7F            ;  7F



END TABLES
