[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

X server source level hack advice: Your 2 bits wanted, please




Hello,

  I am trying to make an X server accept data from an A/D converter and
disguise it as X events. Since I'm rather green with X server internals,
I'd like to know where I could start, and whether there is some provision
to inject X events into the event stream from the outside.

  The opinion of anyone who is GOOD at X programming is welcome here, as
my other option is, to get the server source, and take it apart. I am not
at all shy to do this (I'd do it out of curiosity if nothing else,
remember that I already did that with a Linux kernel ;).

  Again, a more detailed description of the problem and of what I am
trying to do:

- I have designed and built an A/D converter for the parallel port, with 8
bits per channel, and 8 channels. This works well. For the moment, I have
connected a joystick to it, but this is not its intended primary use.

- I have written a low level driver that reads the channels and supplies
values.  It can be switched between cooked and raw mode. In raw mode, it
reads out data and sends it to an application as a delimited packet of
bytes. In cooked mode it uses an adaptive threshold to detect changes in
input and sends data only on change, for the channel(s) that change(s).

  I want this cooked mode driver modified (by me) to trigger an X event
and perhaps send the data of the changed channel along with it as an X
event. In any case, I need to notify an X application about an event such
that it will itself get the data by calling the driver code or a
user-level interface to it. 

  I'd very much like this to be a key-like event so as to be easily built
into existing programs (by configuring the key-map and such).

  Question: Which part of the source tree of an X server (Free86 of
course) is most amenable to such a change, knowing that the change will
probably replace a rarely-used keystroke as event source (or double it).

  Of course, a SYS signal to the server that can do this is MUCH better
than anything else, especially if it already exists (but I know of no such
thing in X). 

Please don't let me down on this, I know that you know ;)

thanks, 

	Peter