From: Ralf A. <ra...@sh...> - 2001-06-25 18:47:17
|
On Fri, 22 Jun 2001, Vojtech Pavlik wrote: > On Fri, Jun 22, 2001 at 01:41:02PM +0200, Ralf Ackermann wrote: > > Hello, > > > > after reading input.txt in the kernel documentation my question is: > > - Is there a way / interface to generate (feed into the kernel) > > events into the kernel? > > I mean - the opposite to /dev/input/eventX (that can be read) - > For complete functionality like this you'll need something ala evdev, > but turned inside out. It hasn't been written yet, though I was planning > it. Based on the information/code from Alessandro Rubini http://www.linux.it/kerneldocs/input/input.html i've made a code snippet that lets you feed in keyboard (or other, e.g. mouse, if you just do minor changes) events via a device /dev/key_in into the kernel from user space. That makes testing input adapter programs that can even be network-transparent (e.g. you feed in the input data via the net) very easy. http://www.iptel-now.de/HOWTO/INPUT_DECOMPOSED/input_decomposed.html There's a small Tcl/Tk program in a subdirectory that shows how it works and lets you test. I intend to use this mechanism for the PS/2-via serial input adapter http://www.iptel-now.de/HOWTO/PS2SER/ps2ser.html that interleaves PS/2 keyboard and mouse input via just 1 serial line. Keyboard input will be fed in this way whereas mouse input (for X only) uses the a2x mechanism. The receiver program doing this can easily run in user space now (at least for developing / testing). I know how to combine the 2 serial outputs from the uCs doing the PS/2=>serial conversion via just an AND gate and a mutex using 2 uC input/output lines now - thanks to the wearable list that gave me valuable hints. Complete schematics/code to be posted soon. Hopefully the code can be an utility/example explaining how to use the input layer in a "decomposed way" in general. regards ralf -- Best regards, Ralf Ackermann |