![Kevin Lange](/assets/img/avatar_default.png)
* Finally bring syscall.h up to speed and include all syscalls in the syscall module of the C library. * Remove the third-party obfuscated C demos (we have nyancat, good enough) * Fix userspace apps to build without complaining about undeclared strtok_r by disable __STRICT_ANSI__ * Fix .eh_frame by including the proper stuff with libgcc.
32 lines
441 B
C
32 lines
441 B
C
/*
|
|
* keyboard-test
|
|
*
|
|
* Waits for key presses in locked keyboard mode
|
|
* and prints them to the screen.
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <stdint.h>
|
|
#include <syscall.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
|
|
int main(int argc, char ** argv) {
|
|
|
|
syscall_kbd_mode(1);
|
|
|
|
int playing = 1;
|
|
while (playing) {
|
|
|
|
char ch = 0;
|
|
ch = syscall_kbd_get();
|
|
if (ch) {
|
|
printf("Pressed key %d\n", ch);
|
|
}
|
|
}
|
|
|
|
syscall_kbd_mode(0);
|
|
|
|
return 0;
|
|
}
|