Joerg Leisenberg (jgleisen++at++immd9.informatik.uni-erlangen.de)
Tue, 5 Sep 1995 22:08:33 -0600
I don't know how Performer 2.0 handles external devices (if it will
be released at all :) but this is what I know for 1.2:
a) You're using GL for input
-----------------------------
Kent Miller <blastarr++at++ix.netcom.com> has mailed a solution a few months
ago:
- look at the code in /usr/src/Performer/src/lib/pfutil/input.[ch]
It's pretty straightforward, and you'll feel better once you're
familiar with it.
- queue the spaceball device events (see device.h for SB events)
- register your spaceball input handler with pfuAddInputHandler, and
use the PFU_CATCH_UNKNOWN parameter so normal keyboard and mouse
events get handled first.
- you can ignore the custom event struct that gets passed to your
handler, since it's just used by CATCH_ALL to pass events back to
the pfu calling routine.
- treat the dev and val args like normal GL events.
b) You're using X11 for input
-----------------------------
Extending the pfu handler (as above) is *NOT* possible if you're
using the pfu API.
Why?
- To Use XExtensionEvents you have to open the XDevice "spaceball"
and you have to select particular XExtensionEvents.
This has to be done from the process that read's the X events
which is (unfortunately) a separate process forked by pfuInitInput.
- You can't use the custom event struct because XExtensionEvents
will not come one by one (as queued gl devices). They will come
with a complete snapshot of all 6 dimensions.
That means you have to generate 6 custom events (one dimensional!)
for each XExtensionEvent. That's not possible.
If you're not using the custom event struct than you've to handle
the events directly out of your handler (i.e. the function added
with pfuAddInputHandler). Be aware that your code is executed
from a separate process (the input process) and therefore
variables must be placed in shared memory etc pp.
I've written a complete X11 Event handler able to read keyboard,
mouse and spaceball - just drop me a line if you're interested.
Regards,
Joerg
-- _____________________________________________________________________________Joerg Leisenberg jgleisen++at++immd9.informatik.uni-erlangen.de * PGP Key available _____________________________________________________________________________
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:52 PDT