Subversion Repositories pentevo

Rev

Rev 292 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed | ?url?

  1. #ifndef __KB_MAP_H__
  2. #define __KB_MAP_H__
  3.  
  4. /**
  5.  * @file
  6.  * @brief PS/2 to ZX keyboard mapping support.
  7.  * @author http://www.nedopc.com
  8.  *
  9.  * PS/2 to ZX keyboard mapping support.
  10.  */
  11.  
  12. /** ZX keyboard values */
  13. //
  14. #define KEY_SP  0
  15. #define KEY_EN  1
  16. #define KEY_P   2
  17. #define KEY_0   3
  18. #define KEY_1   4
  19. #define KEY_Q   5
  20. #define KEY_A   6
  21. #define KEY_CS  7
  22. //
  23. #define KEY_SS  8
  24. #define KEY_L   9
  25. #define KEY_O  10
  26. #define KEY_9  11
  27. #define KEY_2  12
  28. #define KEY_W  13
  29. #define KEY_S  14
  30. #define KEY_Z  15
  31. //
  32. #define KEY_M  16
  33. #define KEY_K  17
  34. #define KEY_I  18
  35. #define KEY_8  19
  36. #define KEY_3  20
  37. #define KEY_E  21
  38. #define KEY_D  22
  39. #define KEY_X  23
  40. //
  41. #define KEY_N  24
  42. #define KEY_J  25
  43. #define KEY_U  26
  44. #define KEY_7  27
  45. #define KEY_4  28
  46. #define KEY_R  29
  47. #define KEY_F  30
  48. #define KEY_C  31
  49. //
  50. #define KEY_B  32
  51. #define KEY_H  33
  52. #define KEY_Y  34
  53. #define KEY_6  35
  54. #define KEY_5  36
  55. #define KEY_T  37
  56. #define KEY_G  38
  57. #define KEY_V  39
  58. //
  59. #define NO_KEY 0x7F
  60. //#define RST_48 0x7E
  61. //#define RST128 0x7D
  62. //#define RSTRDS 0x7C
  63. //#define RSTSYS 0x7B
  64. #define CLRKYS 0x7A
  65. //
  66.  
  67. /** Pointer to map. */
  68. //extern UBYTE* kbmap;
  69. /** Pointer to map (extent E0). */
  70. //extern UBYTE* kbmap_E0;
  71.  
  72. /** Pointer to default map. */
  73. //extern const UBYTE default_kbmap[];
  74. /** Pointer to default map (extent E0). */
  75. //extern const UBYTE default_kbmap_E0[];
  76.  
  77. /** Init keyboard mapping. */
  78. void kbmap_init(void);
  79.  
  80. /** Data type for map values. */
  81. typedef union
  82. {
  83.         struct
  84.         {
  85.                 UBYTE b1;
  86.                 UBYTE b2;
  87.         } tb;
  88.         UWORD tw;
  89. }
  90. KBMAP_VALUE;
  91.  
  92. /**
  93.  * Get keyboard map value.
  94.  * @return map values
  95.  * @param scancode [in] - code from PS/2 keyboard
  96.  * @param was_E0 [in] - 0: code without prefix, >0: code with prefix E0
  97.  */
  98. KBMAP_VALUE kbmap_get(UBYTE scancode, UBYTE was_E0);
  99.  
  100. #endif //__KB_MAP_H__
  101.