2020-10-24 11:18:48 -04:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
2020-10-25 15:58:00 -04:00
|
|
|
#include "emul.h"
|
2020-10-24 11:18:48 -04:00
|
|
|
|
|
|
|
#define KBD_BUFSZ 0x10
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint8_t kc; // last keycode to be pressed. 0 means none.
|
|
|
|
bool breaking; // whether we should send 0xf0 before kc
|
|
|
|
Tristate *TH;
|
|
|
|
} Kbd;
|
|
|
|
|
|
|
|
void kbd_init(Kbd *kbd, Tristate *TH);
|
|
|
|
void kbd_pressshift(Kbd *kbd, bool ispressed);
|
|
|
|
void kbd_presskey(Kbd *kbd, uint8_t keycode);
|
|
|
|
uint8_t kbd_rd(Kbd *kbd);
|