git.samba.org
/
tridge
/
junkcode.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
added hashmatch
[tridge/junkcode.git]
/
kbd.c
1
#include <stdio.h>
2
#include <fcntl.h>
3
#include <sys/kd.h>
4
5
main()
6
{
7
int kbd = open("/dev/console", O_RDWR | O_NDELAY);
8
char buf[60];
9
int n,i;
10
11
ioctl(kbd, KDSKBMODE, K_RAW);
12
13
while (1)
14
{
15
n = read(kbd,buf,60);
16
if (n==0) continue;
17
for (i=0;i<n;i++)
18
printf("%x\n",buf[i]);
19
}
20
21
}