/********************************************************************************/ /********************************************************************************/ libjstick README - dzimmer@magma.ca /********************************************************************************/ /********************************************************************************/ About the demo: The demo only bothers with processing the XY axes of the joystick, and the first button, however defining DEBUG will print messages for other events... and the library has been tested for fully-featured joysticks. Also, the 3D navigation code is limited, since the app is only designed for testing purposes. FLTK-specific files jtest_fltk.cxx - fltk UI cb_fltk.cpp - fltk callbacks cgfx_x.cpp - fltk class for 2D window cgfx_gl.cpp - fltk class for 3D OpenGL window XFORMS-specific files jtest_xforms.c - xforms UI (also see jtest_xforms_add.c) cb_xforms.c - xforms callbacks The rest of the code is toolkit-neutral. A single "window" test may be in order at some point, to demonstrate the simplicity and flexibility of the library. If your joystick is not recognized under Linux, you may need to insert some modules (as root). The following works for my Logitech Digital Extreme 3D (the last module is specific to the joystick): /sbin/insmod joydev /sbin/insmod gameport /sbin/insmod adi /********************************************************************************/ /********************************************************************************/ Bugs: In Windows XP, calling joyReleaseCapture() prevents successive calls to joySetCapture() from working, thus braking this library. The program found under winxp_test_mmjoy demonstrates this using only the native win32 mmJoy calls. I have assumed that this is a bug that Microsoft is not going to bother to fix, since DirectX has replaced winmm. The only solution is to change this library to use DirectX. If anyone would like to contribute some sample code using DirectInput for joysticks, please contact dzimmer@magma.ca /********************************************************************************/ /********************************************************************************/ Library design issues: The XFORMS implementation is slower than that for FLTK, and events tend to pile-up. On slower machines, you can move the stick around, then sit back and watch the GUI catch-up. For xforms and fltk under Linux, joystick events are read using a timeout callback. I am not convinced that this is the best way... it could be done with an idle callback, or listening to an fd. The fltk WIN32 handler is much better since the joystick driver is integrated into the window manager. This could be done with X-Windows by sending user defined events, and I am leaning towards rewriting the library to do this. I would also like to be able to poll the state of the joystick under Linux, however I am not sure that this is possible using linux/joystick.h. The documentation I have reagarding this is fuzzy. Please send any useful solutions or comments regaring these issues to dzimmer@magma.ca /********************************************************************************/ /********************************************************************************/