<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Rémi Denis-Courmont schrieb:
<blockquote cite="mid:201001281223.41787.remi.denis-courmont@nokia.com"
type="cite">
<pre wrap="">On Thursday 28 January 2010 11:53:13 ext Stefan Iwanowitsch, you wrote:
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">If you just want to see keyboard input, then you'd open the corresponding
file(s) in /dev/input/.
</pre>
</blockquote>
<pre wrap="">Can I read from /dev/input without interfering with other consumers?
</pre>
</blockquote>
<pre wrap=""><!---->
It should work yes.
</pre>
<blockquote type="cite">
<pre wrap="">And do you happen to know, where I can find specs
on the input device files?
</pre>
</blockquote>
<pre wrap=""><!---->
/sys/class/input provides informations on each entries.
The protocol is documented in Documentation/input/ in the kernel sources:
| You can use blocking and nonblocking reads, also select() on the
| /dev/input/eventX devices, and you'll always get a whole number of input
| events on a read. Their layout is:
|
| struct input_event {
| struct timeval time;
| unsigned short type;
| unsigned short code;
| unsigned int value;
| };
|
| 'time' is the timestamp, it returns the time at which the event happened.
| Type is for example EV_REL for relative moment, EV_KEY for a keypress or
| release. More types are defined in include/linux/input.h.
|
| 'code' is event code, for example REL_X or KEY_BACKSPACE, again a complete
| list is in include/linux/input.h.
|
| 'value' is the value the event carries. Either a relative change for
| EV_REL, absolute new value for EV_ABS (joysticks ...), or 0 for EV_KEY for
| release, 1 for keypress and 2 for autorepeat.
</pre>
</blockquote>
I set up some testcode to check the /dev/input/* files but I didn't
read a single byte from them.<br>
Does this work with scratchbox?<br>
Thanks for your help!<br>
<br>
<br>
</body>
</html>