OurOS 0.1
Operating System built by McGill Students
 
Loading...
Searching...
No Matches
keyboard.h
Go to the documentation of this file.
1
5#ifndef _SYS_KEYBOARD_H
6#define _SYS_KEYBOARD_H
7
8#include <stdbool.h>
9#include "keycode.h"
10
15 bool shift;
16 bool ctrl;
17 bool alt;
18 bool caps;
19};
20
26typedef bool (*hal_poll_func_t)(void);
27
33 bool pressed;
34 enum KEYCODE keycode;
35};
36
43
49bool keyboard_poll();
50
56bool keyboard_pop_event(struct keyboard_event *event);
63void keyboard_push_event(struct keyboard_event event);
64
71
72#endif
void keyboard_push_event(struct keyboard_event event)
push event to the keyboard event queue
Definition keyboard.c:62
struct keyboard_state * keyboard_get_state()
get the current modifier state of the keyboard
Definition keyboard.c:72
bool(* hal_poll_func_t)(void)
typedef for generic hal polling function pointer.
Definition keyboard.h:26
int keyboard_init(hal_poll_func_t poll)
function to initialize the kernel keyboard system
Definition keyboard.c:16
bool keyboard_pop_event(struct keyboard_event *event)
pop an event from the keyboard event queue.
Definition keyboard.c:27
bool keyboard_poll()
function to poll the keyboard for available events
Definition keyboard.c:23
struct that holds a keyboard event
Definition keyboard.h:32
bool pressed
Definition keyboard.h:33
enum KEYCODE keycode
Definition keyboard.h:34
struct to hold state of the keyboard in terms of modifier keys
Definition keyboard.h:14
bool shift
Definition keyboard.h:15
bool ctrl
Definition keyboard.h:16
bool caps
Definition keyboard.h:18
bool alt
Definition keyboard.h:17