home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD v1.2 / amidev_cd_12.iso / reference / amiga_mail_vol2 / xi-25 / appkeymap.h < prev    next >
C/C++ Source or Header  |  1996-01-30  |  2KB  |  73 lines

  1. #define UP_KEY      0x4C   /* Raw keys which are the same on all keyboards */
  2. #define DOWN_KEY    0x4D
  3. #define RIGHT_KEY   0x4E
  4. #define LEFT_KEY    0x4F
  5.  
  6. #define F1_KEY      0x50
  7. #define F2_KEY      0x51
  8. #define F3_KEY      0x52
  9. #define F4_KEY      0x53
  10. #define F5_KEY      0x54
  11. #define F6_KEY      0x55
  12. #define F7_KEY      0x56
  13. #define F8_KEY      0x57
  14. #define F9_KEY      0x58
  15. #define F10_KEY     0x59
  16.  
  17. #define N0_KEY      0x0F
  18. #define N1_KEY      0x1D
  19. #define N2_KEY      0x1E
  20. #define N3_KEY      0x1F
  21. #define N4_KEY      0x2D
  22. #define N5_KEY      0x2E
  23. #define N6_KEY      0x2F
  24. #define N7_KEY      0x3D
  25. #define N8_KEY      0x3E
  26. #define N9_KEY      0x3F
  27.  
  28. #define NPERIOD_KEY 0x3C
  29. #define NOPAREN_KEY 0x5A
  30. #define NCPAREN_KEY 0x5B
  31. #define NSLASH_KEY  0x5C
  32. #define NASTER_KEY  0x5D
  33. #define NMINUS_KEY  0x4A
  34. #define NPLUS_KEY   0x5E
  35. #define NENTER_KEY  0x43
  36.  
  37. /* Sizes of the "Lo" and "Hi" KeyMap tables */
  38.  
  39. #define LO_MAP_SIZE  64   /* Notice that the Lo and Hi tables are NOT the same */
  40. #define HI_MAP_SIZE  56   /* size!  The Lo tables have eight more entries than */
  41. #define LO_TYPE_SIZE 64   /* the Hi tables.  The RKM is incorrect in saying    */
  42. #define HI_TYPE_SIZE 56   /* that the Lo and Hi tables are the same size.      */
  43. #define LO_CAPS_SIZE 8        /* 8 bytes x 8 bits-per-byte = */
  44. #define HI_CAPS_SIZE 7        /* 7 bytes x 8 bits-per-byte = */
  45. #define LO_REPS_SIZE 8        /* 64 bit-wide entries.        */
  46. #define HI_REPS_SIZE 7        /* 56 bit-wide entries.        */
  47.  
  48. void AlterAppKeyMap (struct KeyMap *,
  49.              struct MyKey *,
  50.              UWORD);
  51. struct KeyMap *CreateAppKeyMap (struct KeyMap *);
  52. void DeleteAppKeyMap (struct KeyMap *);
  53. UBYTE FindMaxDeadKey(struct KeyMap *);
  54.  
  55. struct MyKey /* AlterAppKeyMap() expects an array of MyKey structures. */
  56.              /* This structure contains all the information needed to  */
  57.              /* redefine a key mapping.                                */
  58. {
  59.   UBYTE RawCode;
  60.   UBYTE MapType;    /* Qualifier flags and key type. */
  61.   UBYTE Capsable;   /* Is this key Capsable?         */
  62.   UBYTE Repeatable; /* Is this key Repeatable?       */
  63.   ULONG Map;        /* This field either points to some key data or */
  64. };                  /* contains a four-byte table of ANSI values.   */
  65.  
  66. struct KeyMapArrays  /* We allocate each Lo and Hi table pair as a single array */
  67. {
  68.   ULONG LHKeyMap[LO_MAP_SIZE << 1];
  69.   UBYTE LHKeyMapTypes[LO_TYPE_SIZE << 1];
  70.   UBYTE LHCapsable[LO_CAPS_SIZE << 1];
  71.   UBYTE LHRepeatable[LO_REPS_SIZE << 1];
  72. };
  73.