Hi Brian, (01)
I managed to write some C code to do basic event handling for the analog
gameport joystick, connecting through USB. (02)
It works as I was hoping, namely that the USB stuff is transparent, and
when I read from the /dev/input/js0 device, the standard linux
joystick driver gives me back values in that simple data structure I
mentioned to you earlier. (03)
It pretty much just keeps sending values continually, but I can build my
own event handler just by storing the state of the previous values and
comparing when they change. (04)
For now, I have the event handler program tracking (x,y) values as they
change, and also when the button0 and button1 is pressed or released (my
joystick has two buttons). Since the events are independent, I can tell
when either or both buttons are pressed and released. (05)
The good news is that the joystick driver code appears to support up to
32 buttons. So I think we may not even need to do anything special with
mapping the chord keyset keys to x or y coordinates. It should be
possible to map all five keyset keys directly, although I don't know
what bits need to be sent at a hardware level in order for the driver to
recognize them as the first five buttons instead of coordinates. (06)
--Jon (07)
|