home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / dvorak.zip / DVORAK.H < prev    next >
C/C++ Source or Header  |  1994-01-17  |  3KB  |  91 lines

  1. /* DVORAK header file */
  2.  
  3. #pragma pack(1)
  4. typedef unsigned int        WORD;    /* 16-bit unsigned thing */
  5. typedef unsigned char    BYTE;
  6. typedef char                CHAR;
  7. typedef short                SHORT;
  8. typedef unsigned long    BITFIELD;  /* for readability */
  9. typedef int                    INT;
  10. typedef void                VOID;
  11. typedef long                LONG;
  12. typedef unsigned long    ULONG;
  13.  
  14. /* code page header */
  15. typedef struct XHeader
  16. {
  17.     WORD    XTableID;       /* code page number */
  18.  
  19.     /* note: 32-bit wide field */
  20.     struct
  21.     {
  22.         /* which shift key or key combo affects Char3 of each KeyDef */
  23.         BITFIELD    ShiftAlt    :1; /* use shift-alt instead of ctrl-alt */
  24.         BITFIELD    AltGrafL    :1; /* use left alt key as alt-graphics */
  25.         BITFIELD    AltGrafR    :1; /* use right alt key as alt-graphics */
  26.         /* other modifiers */
  27.         BITFIELD    ShiftLock   :1; /* treat caps lock as shift lock */
  28.         BITFIELD    DefaultTable:1; /* default table for the language */
  29.         BITFIELD    ShiftToggle :1; /* TRUE: toggle, FALSE: latch shiftlock */
  30.         BITFIELD    AccentPass  :1; /* TRUE: pass on accent keys and beep,
  31.                                     FALSE: just beep */
  32.         BITFIELD    CapsShift   :1; /* caps-shift uses Char5 */
  33.         BITFIELD    MachDep     :1; /* machine-dependent table */
  34.     } XTableFlags1;
  35.  
  36.     WORD    KbdType;            /* keyboard type */
  37.     WORD    KbdSubType;         /* keyboard sub-type */
  38.     WORD        XtableLen;          /* length of table */
  39.     WORD    EntryCount;         /* number of KeyDef entries */
  40.     WORD    EntryWidth;         /* width in bytes of KeyDef entries */
  41.     BYTE    Country[2];         /* country ID, i.e. 'US' */
  42.     WORD    TableTypeID;        /* Table type, 0001=OS/2 */
  43.     BYTE    SubCountryID[4];    /* sub-country ID, ASCII, i.e. '153 ' */
  44.     WORD    Reserved[8];
  45. } XHeader;
  46.  
  47. /* Key definition, one per scan code in table */
  48. typedef struct
  49. {
  50.     WORD    XlateOp;
  51.     #define     KeyType     0x01ff  /* low 9 bits */
  52.     #define     AccentFlags 0xfe00  /* high 7 bits */
  53.  
  54.     BYTE    Char1;
  55.     BYTE    Char2;
  56.     BYTE    Char3;
  57.     BYTE    Char4;
  58.     BYTE    Char5;
  59. } KeyDef;
  60.  
  61. typedef struct
  62. {
  63.     WORD    word1;
  64.     BYTE    Country[2];     /* i.e. 'US' */
  65.     BYTE    SubCountryID[4];    /* i.e. '153 ' */
  66.     WORD    word2;
  67.     WORD    XTableID;       /* i.e. 0x1b5 (437) */
  68.     WORD    word3;
  69.     ULONG   HeaderLocation; /* of beginning of table (header) */
  70. } IndexEntry;
  71.  
  72. #define MAX_ASSIGN 40
  73.  
  74. /* shift flags */
  75. #define SF_RIGHTSHIFT               0x0001
  76. #define SF_LEFTSHIFT                0x0002
  77. #define SF_CONTROL                  0x0004
  78. #define SF_ALT                      0x0008
  79. #define SF_SCROLLLOCK_ON            0x0010
  80. #define SF_NUMLOCK_ON               0x0020
  81. #define SF_CAPSLOCK_ON              0x0040
  82. #define SF_INSERT_ON                0x0080
  83. #define SF_LEFTCONTROL              0x0100
  84. #define SF_LEFTALT                  0x0200
  85. #define SF_RIGHTCONTROL             0x0400
  86. #define SF_RIGHTALT                 0x0800
  87. #define SF_SCROLLLOCK               0x1000
  88. #define SF_NUMLOCK                  0x2000
  89. #define SF_CAPSLOCK                 0x4000
  90. #define SF_SYSREQ                   0x8000
  91.