/*
   joy2key 
   
   This program gets events from the joystick device /dev/input/js0 and
   dispatches X events or console keypresses to a specific window
   based on joystick status.  It is most useful for adding joystick
   support to games that don't nativly support the joystick, using
   joy2key to send XKeyPress (or console ioctl()) messages in place of
   actually typing movement keys.  This code is under the GNU Public
   License (see COPYING), you can do whatever you want to it, and if
   you do anything really neat, I'd like to see it!

		- Peter Amstutz (tetron@interreality.org)

		special thanks to Zhivago of EFNet's #c for helping me out 
		a LOT with the XSendEvent() code...

		The latest version of joy2key can be found in 
			ftp://sunsite.unc.edu/pub/Linux/X11/xutils
		or on joy2key's (rather spartan) website,
			http://www-unix.oit.umass.edu/~tetron/joy2key

		Revision History
		----------------
        1.0 (12 Aug 1997) - First version.
        1.1 (04 Dec 1997) - Thanks to Craig Lamparter 
		                    (craiger@hemna.rose.hp.com), 
		                    joy2key now has support for four-buttoned 
                            joysticks/gamepads!  Also some bugfixes.
        1.2 (28 Apr 1998) - Pierre Juhen (pierre.juhen@wanadoo.fr) 
		                    fixed a dumb little bug and added the 
                            autorepeat feature!  
        1.3 (04 Jun 1998) - Frederic Lepied (fred@sugix.frmug.org) added 
		                    option to call w/o the window title arg to 
                            select target window interactivly 
                            (gee, why didn't I do that in the first 
                            place?) and detect when the window closed and
                            exit properly.  Also now uses 1.0 joystick 
                            module event-based handling instead of 
                            polling (now _requires_ 1.0+ joystick driver,
                            which is available for v2.0+ Linux kernels),
                            and is able to send events to the console 
                            with an ioctl() as well!
                            Lots of code cleanup and restructuring.
        1.4 (17 Aug 1998) - .joy2keyrc implemented, this adds -rcfile and 
                            -config.  Bugfix for -dev command.  Also 
                            automatic calibration when no -thresh is found, 
                            added -deadzone option.
        1.5 (20 Jul 1999) - Patch by Jeremy (jeremy@xxedgexx.com) to look up 
                            windows by their numeric ID when they cannot by 
                            found by name; this makes it possible to use 
                            joy2key with full-screen (DGA) X apps.
                            Joy2key also now uses autoconf/automake.
	1.6 (10 Apr 2001) - Okay, after getting mail about it for
                            literally years, I've finally fixed the
			    bug parsing joy2keyrc files...  ;-p
	1.6.1 (27 Jan 2005) - Just a trivial update to fix the web page
	                    and email addresses.
	1.6.2 (22 Mar 2007) Rens (mraix@xs4all.nl)
                          - Fixed a bug, preventing joy2key from using your
                            highest numbered button.
                          - Made joy2key lower case / upper case - aware
                            by simulating actual keyboard behaviour: capital
                            A is generated like this:
                            key-shift-down, key-"a"-down, key-"a"-up, key-shift-up
                            Exactly as you would type it..... It sounds trivial,
                            but I found out that a lot of games
                            ( Especially Windoze games running in Wine )
                            require exact simulation of the keyboard-presses
                            or there will be no joy(2key).
	1.6.3 (12 Apr 2008) Peter Alfredsen (peter.alfredsen@gmail.com)
                          - Fix up a few compiler warnings.
                          - Once and for all fix configure.ac so it works.
                          - Merge Debian, OpenSuse and Gentoo patches.
                            Related bugs:
                              Opensuse:
                                https://bugzilla.novell.com/226508
                              Gentoo:
                                http://bugs.gentoo.org/82685
                              Debian:
                                http://bugs.debian.org/365146
                                http://bugs.debian.org/404543
                                http://bugs.debian.org/404550
                          - Fix up the ... unique ... coding style that Rens
                            Introduced. Merge only relevant parts of his changes.
                            Change comment style to C.
*/
