luajitos

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

keyboard.h (600B)


      1 #ifndef KEYBOARD_H
      2 #define KEYBOARD_H
      3 
      4 #include <stdint.h>
      5 
      6 /* Keyboard ports */
      7 #define KB_DATA_PORT    0x60
      8 #define KB_STATUS_PORT  0x64
      9 #define KB_COMMAND_PORT 0x64
     10 
     11 /* Keyboard state */
     12 typedef struct {
     13     uint8_t shift_pressed;
     14     uint8_t ctrl_pressed;
     15     uint8_t alt_pressed;
     16     uint8_t caps_lock;
     17     int initialized;
     18 } keyboard_state_t;
     19 
     20 extern keyboard_state_t keyboard_state;
     21 
     22 /* Initialize keyboard */
     23 void keyboard_init(void);
     24 
     25 /* Keyboard interrupt handler */
     26 void keyboard_handler(void);
     27 
     28 /* Get keyboard state */
     29 keyboard_state_t keyboard_get_state(void);
     30 
     31 #endif /* KEYBOARD_H */