luajitos

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

mouse.h (515B)


      1 #ifndef MOUSE_H
      2 #define MOUSE_H
      3 
      4 #include <stdint.h>
      5 #include <lua.h>
      6 
      7 /* Mouse state structure */
      8 typedef struct {
      9     int x;
     10     int y;
     11     uint8_t buttons;  /* Bit 0: left, Bit 1: right, Bit 2: middle */
     12     int initialized;
     13 } mouse_state_t;
     14 
     15 /* Initialize PS/2 mouse */
     16 int mouse_init(void);
     17 
     18 /* Handle mouse interrupt (IRQ12) */
     19 void mouse_handler(void);
     20 
     21 /* Get current mouse state */
     22 void mouse_get_state(mouse_state_t* state);
     23 
     24 /* Lua binding */
     25 int lua_mouse_get_state(lua_State* L);
     26 
     27 #endif /* MOUSE_H */