Renamed keyboard.c's KeyEvent -> key_event_t
This commit is contained in:
@@ -155,10 +155,10 @@ volatile int keyboard_allowKeyRepeat = 0;
|
|||||||
volatile char keyboard_keyStates[KEY_MAX];
|
volatile char keyboard_keyStates[KEY_MAX];
|
||||||
|
|
||||||
enum { KEYPRESSED, KEYRELEASED };
|
enum { KEYPRESSED, KEYRELEASED };
|
||||||
typedef struct { unsigned char type, code, isrepeat; } KeyEvent;
|
typedef struct { unsigned char type, code, isrepeat; } key_event_t;
|
||||||
|
|
||||||
volatile struct {
|
volatile struct {
|
||||||
KeyEvent data[32];
|
key_event_t data[32];
|
||||||
unsigned readi, writei;
|
unsigned readi, writei;
|
||||||
} keyboard_events;
|
} keyboard_events;
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ void keyboard_handler() {
|
|||||||
code = inportb(0x60);
|
code = inportb(0x60);
|
||||||
|
|
||||||
if (code != 224) {
|
if (code != 224) {
|
||||||
volatile KeyEvent *e;
|
volatile key_event_t *e;
|
||||||
/* Handle key up / down */
|
/* Handle key up / down */
|
||||||
if (code & (1 << 7)) {
|
if (code & (1 << 7)) {
|
||||||
/* Key up */
|
/* Key up */
|
||||||
@@ -239,7 +239,7 @@ int keyboard_isDown(const char *key) {
|
|||||||
void keyboard_update(void) {
|
void keyboard_update(void) {
|
||||||
/* Handle key press / release */
|
/* Handle key press / release */
|
||||||
while (keyboard_events.readi != keyboard_events.writei) {
|
while (keyboard_events.readi != keyboard_events.writei) {
|
||||||
KeyEvent ke = keyboard_events.data[keyboard_events.readi++ & BUFFER_MASK];
|
key_event_t ke = keyboard_events.data[keyboard_events.readi++ & BUFFER_MASK];
|
||||||
event_t e;
|
event_t e;
|
||||||
if (ke.type == KEYPRESSED) {
|
if (ke.type == KEYPRESSED) {
|
||||||
e.type = EVENT_KEYBOARD_PRESSED;
|
e.type = EVENT_KEYBOARD_PRESSED;
|
||||||
|
|||||||
Reference in New Issue
Block a user