feat(keyboard): add getkey function

This commit is contained in:
aliamelo committed 2021-07-16 03:24:01 +02:00
1 parent a98c35a226
commit d255839400
3 files changed
+44 -1

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
#include "pic/keyboard.h"
#include "io.h"
#include "stdio.h"
int8_t getkey(void)
{
uint8_t key = inb(KEYBOARD_IO);
if (key & KEYBOARD_RELEASE)
return -1;
return key;
}
+13
View File
@@ -0,0 +1,13 @@
#ifndef KEYBOARD_H
#define KEYBOARD_H
#define KEYBOARD_IO 0x60
#define KEYBOARD_STATUS 0x64
#define KEYBOARD_RELEASE 0x80
#include <stdint.h>
int8_t getkey(void);
#endif /* !KEYBOARD_H */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.