mjoytest [-j joystick] [[-m] video mode]
This demo program utilizes joysticks 0 and 1 in graphics mode.
If you specify a joystick number, only this is used. The demo separates the screen in two parts where you can move a cursor around with the resp. joystick. Pressing button 2 changes the color, pressing button 1 draws.
It also prints the current joystick position to the screen.
Internally the demo also shows the use of custom joystick handlers and how to recalibrate a joystick in graphics mode (press key <1> and <2> respectively.
After the demo runs and the joysticks are initialized it is possible to share the joysticks with another application (as long as it releases the joysticks upon a VC switch as well).
Pressing <Q> exits.
After a vc switch the demo occasionally hangs in vga_waitevent(3) not timing out (hence the joysticks block). It is not clear if it is a conceptional problem or bug in vga_waitevent(3) or the kernel. Simply press any key to revive the demo.
This demo is part of svgalib and can be found in the demos/ subdirectory of the original svgalib distribution. However, it is not installed in the system by default, s.t. it is unclear where you can find it if your svgalib was installed by some linux distribution. Even then, when you have the demo on your system, you probably won't have the sources s.t. it is only of limited use for you.
In case of any such problem, simply get an svgalib distribution from the net. You even don't need to install it. Just make in the demos/ subdirecty. As of this writing, svgalib-1.3.0.tar.gz is the latest version and can be retrieved by ftp from sunsite.unc.edu at /pub/Linux/libs/graphics and tsx-11.mit.edu at /pub/linux/sources/libs which will most probably be mirrored by a site close to you.
The functions used by this demo are only available in ELF versions of svgalib. Due to backwards compatibility issues it cannot be used with shared a.out libs.
svgalib(7), vgagl(7), libvga.config(5), threed(6), accel(6), bg_test(6), eventtest(6), forktest(6), fun(6), keytest(6), scrolltest(6), speedtest(6), spin(6), testaccel(6), testgl(6), testlinear(6), vgatest(6), plane(6), wrapdemo(6), vgatest(6), joytest(6), joystick_init(3), joystick_close(3), joystick_update(3), joystick_sethandler(3), joystick_setdefaulthandler(3), joystick_getnumaxes(3), joystick_getnumbuttons(3), joystick_getaxis(3), joystick_getbutton(3), joystick_button1(3), joystick_getb1(3), joystick_x(3), joystick_getx(3).
The svgalib joystick handler was mostly done by Daniel Engstr\"om <firstname.lastname@example.org>. Multiple joystick, VC switching support and code to glue it into svgalib by Michael Weller <email@example.com>. Part of the code is based on code from C. Smith and Vojtech Pavlik.
joystick_close(3), joystick_getaxis(3), joystick_getnumaxes(3), joystick_init(3), joystick_sethandler(3), joystick_update(3), joytest(6), svgalib(7).