update to xf86-input-joystick 1.4.1
This commit is contained in:
parent
b6284c47f6
commit
1f84578193
@ -1,3 +1,532 @@
|
||||
commit 88a084952f547ebc2f30a257e441930024a69be9
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Tue Apr 14 22:33:01 2009 +0200
|
||||
|
||||
Fail configure on xorg-server >= 1.6.99
|
||||
|
||||
The 1.4 branch is broken on xorg-server >= 1.6.99. Use master instead.
|
||||
|
||||
commit 7d6a068c29e372747fc621020976797df9f61bac
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Tue Apr 14 22:25:49 2009 +0200
|
||||
|
||||
Bump 1.4.1
|
||||
|
||||
commit e1710072396a97369ef71b1fd1738ad092a5e902
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Thu Mar 19 21:14:22 2009 +0100
|
||||
|
||||
Fix compiler warning about stray INT8-CARD8 conversion
|
||||
|
||||
commit 7af61c78fd48ea9cc2442fb55570ba0d9f37f8c8
|
||||
Merge: bc430cc 4b9aafd
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Thu Mar 19 21:13:13 2009 +0100
|
||||
|
||||
Merge branch 'pwm'
|
||||
|
||||
commit bc430cc2aacdcda45ddc38d457b84ff040be6a8c
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Thu Mar 19 21:08:30 2009 +0100
|
||||
|
||||
Missing initialization of button amplify
|
||||
|
||||
Always initialize button[]->amplify with 1.0
|
||||
|
||||
commit dca19bde2bdd275744e9182dd49a2f2dd81f8c81
|
||||
Merge: 6f2a211 c6217b5
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Thu Mar 19 08:36:10 2009 +0100
|
||||
|
||||
Merge branch 'master' of sascha:develop/xorg/xf86-input-joystick
|
||||
|
||||
commit 4b9aafd82bf78e86b2b2ddc78c37d73ccc7c25d5
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Wed Mar 18 18:13:12 2009 +0100
|
||||
|
||||
Mention PWM mode in man page
|
||||
|
||||
commit 6f2a211b7c3b45e8de9a90835fb7f1a24635c8e5
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Wed Mar 18 17:39:07 2009 +0100
|
||||
|
||||
Fix build on FreeBSD with USB2
|
||||
|
||||
Including dev/usb/usb_ioctl.h fixes missing declaration
|
||||
of USB_GET_REPORT_ID on FreeBSD-Current.
|
||||
|
||||
commit c6217b5849b1c2680a9a8c29ca26b3468955b1c1
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sun Mar 1 21:06:52 2009 +0100
|
||||
|
||||
Comment float properties in joystick-properties.h
|
||||
|
||||
Signed-off-by: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
|
||||
commit 367c32bab57d69d85e95f4e76e2f1c8aaab45189
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sun Mar 1 21:00:18 2009 +0100
|
||||
|
||||
Support for float properties
|
||||
|
||||
Signed-off-by: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
|
||||
commit 4978e78e7c49bc0aabf5c7ade4223c2529a9f046
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Thu Feb 19 23:40:58 2009 +0100
|
||||
|
||||
Add PWM key generation when axis in accelerated mode
|
||||
|
||||
When axis is in accelerated mode and keyhigh/keylow is set,
|
||||
the deflection of the axis will be linked to the _percent of time_ the key
|
||||
will be down. Full deflection will set the key permanently down (old behaviour).
|
||||
|
||||
50% deflection will result in the key being 50ms down and 50ms up.
|
||||
75% deflection will result in the key being 150ms down and 50ms up.
|
||||
etc.
|
||||
Minimum interval is 50ms, maximum is 600ms.
|
||||
|
||||
commit d4bb86ddb0ba570de0f501cd0edb13861456b711
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Thu Feb 19 23:37:46 2009 +0100
|
||||
|
||||
Don't set axis.oldvalue in backend
|
||||
|
||||
The value needs to be set where it's needed, like in timers.
|
||||
|
||||
commit 4ec4376522b1c393ee44f25adcd28b12d7cadff6
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Tue Feb 17 20:18:05 2009 +0100
|
||||
|
||||
Fix for sparse warning of uninitialized variable
|
||||
|
||||
If axis is inside deadzone, 0.0 should be assumed.
|
||||
|
||||
commit b70b1f7d827b87ceb63110c781b01175363fb7d0
|
||||
Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
|
||||
Date: Wed Feb 4 18:23:00 2009 -0200
|
||||
|
||||
Janitor: gcc 4.5 and sparse warnings.
|
||||
|
||||
It is still required a patch in the X Server sdk to correct some
|
||||
remaining warnings. Isn't it amazing that <X11/extensions/XKBsrv.h>
|
||||
and $sdkdir/xkbsrv.h both use the #ifndef _XKBSRV_H_ include guard?
|
||||
|
||||
Signed-off-by: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
|
||||
|
||||
commit 76b82a41a6733ef5a2a89dd370357320ea78792a
|
||||
Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
|
||||
Date: Wed Feb 4 18:10:26 2009 -0200
|
||||
|
||||
Janitor: make distcheck, .gitignore.
|
||||
|
||||
The correction for make distcheck uses the same solution proposed
|
||||
for xf86-input-evdev, that uses the new configure option --with-sdkdir.
|
||||
|
||||
Signed-off-by: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
|
||||
|
||||
commit 4671904035d4da4d112f53cce8781bcc77b0d0db
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Mon Feb 2 00:10:42 2009 +0100
|
||||
|
||||
Use InitKeyboardDeviceStruct instead of nonexistant XkbInitKeyboardDeviceStruct
|
||||
|
||||
Realizing XkbInitKeyboardDeviceStruct has been removed, we do need to use InitKeyboardDeviceStruct.
|
||||
This breaks custom keymaps on ABI_XINPUT_VERSION >= 5.
|
||||
|
||||
Hopefully this can be reimplemented later.
|
||||
|
||||
commit 3984947ada771619f21b511507a2fb9cca3ed645
|
||||
Author: Alan Coopersmith <alan.coopersmith@sun.com>
|
||||
Date: Fri Jan 30 20:23:09 2009 -0800
|
||||
|
||||
Add README with pointers to mailing list, bugzilla & git repos
|
||||
|
||||
commit fb632ba226725a7101c5c1a3bfc2201905532b6f
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Mon Jan 26 20:48:00 2009 +0100
|
||||
|
||||
Fix build on master. All hail XKB!
|
||||
|
||||
commit f62159e4dfc22550ec2de3eb4fd46027d85a1e88
|
||||
Author: Alan Coopersmith <alan.coopersmith@sun.com>
|
||||
Date: Fri Jan 9 16:14:12 2009 -0800
|
||||
|
||||
Remove xorgconfig & xorgcfg from See Also list in man page
|
||||
|
||||
commit 43e2f0526894cb5eacac8730a21ccdf415421d72
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sun Dec 28 18:57:36 2008 +0100
|
||||
|
||||
Prepare for 1.4.0 release
|
||||
|
||||
commit fd80f1c2b5b91e0260dc28e9b5e259025ea379e5
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sun Dec 28 17:32:44 2008 +0100
|
||||
|
||||
Matched comments in joystick-properties.h with previous commit
|
||||
|
||||
commit f81b9077d13b614262556a7401068f016fe2b365
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sun Dec 28 17:28:50 2008 +0100
|
||||
|
||||
Export JSTK_* constants with joystick-properties.h
|
||||
|
||||
commit 79028fc80fe7cbd452a18b4ddf92c328a1fe1393
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sun Dec 28 17:24:08 2008 +0100
|
||||
|
||||
Rename constants for better distinction
|
||||
|
||||
@jstk.h:
|
||||
TYPE_* -> JSTK_TYPE_*
|
||||
MAPPING_* -> JSTK_MAPPING_*
|
||||
|
||||
commit 38b4c9b3bd814296971abfe6ef01f531367a43bb
|
||||
Author: Peter Hutterer <peter.hutterer@redhat.com>
|
||||
Date: Mon Oct 13 10:46:10 2008 +1030
|
||||
|
||||
properties: handle checkonly flag in SetProperty.
|
||||
|
||||
If checkonly is TRUE, don't touch any values, just check vor validity of the
|
||||
data.
|
||||
|
||||
Signed-off-by: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
|
||||
commit 0da072fde42d899b56cc7b05d7b3db2815ac3b9a
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Wed Oct 1 23:14:22 2008 +0200
|
||||
|
||||
Install joystick-properties.h and xorg-joystick.pc for clients.
|
||||
|
||||
Let's clients be aware of properties made available by the driver.
|
||||
|
||||
commit 3c2a323a3a14bc27a7a5d9f4470b4abd83c424ec
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Wed Oct 1 21:43:49 2008 +0200
|
||||
|
||||
Option for per-axis valuators. Defaults to off for all axes.
|
||||
|
||||
Old: Each axis had an extra valuator, starting with 2 (0 and 1 are pointer movement)
|
||||
New: Add "valuator" to axis option to give it an extra valuator of range -32768 to 32768.
|
||||
Default: Off for all axes, since rarely used (and broken anyway right now).
|
||||
|
||||
commit 432805db42b1f7d69131406c8b58571d224e1c47
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Tue Sep 30 19:02:17 2008 +0200
|
||||
|
||||
Remove XKB calls since we don't make use of it anyway.
|
||||
|
||||
No error messages because of missing xkb rules, yay.
|
||||
|
||||
commit 8a5b8e08aa27c5a33982ab293c68c026cba789c5
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Tue Sep 30 18:35:27 2008 +0200
|
||||
|
||||
Do not require randrproto
|
||||
|
||||
commit ba8ea1799cf8911c22b0d90a865cb6e215b23e1c
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Tue Sep 30 18:13:19 2008 +0200
|
||||
|
||||
Support for setting Button Number property
|
||||
|
||||
does not change the button map, which is assumed to be default. Buttons can still be
|
||||
reordered using xmodmap.
|
||||
|
||||
commit 5c72d146865982dfa727d469d789ceaa6ac33b8d
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Tue Sep 30 18:08:04 2008 +0200
|
||||
|
||||
Replace dynamic button map with static one
|
||||
|
||||
Saves some configuration efforts but caps logical button numbers to BUTTONMAP_SIZE=32.
|
||||
Makes property support much easier.
|
||||
|
||||
commit 03175f968c4177de2208a2d8e73f9c8106630a6b
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Tue Sep 30 00:35:01 2008 +0200
|
||||
|
||||
Name all properties uppercase
|
||||
|
||||
Just looks better
|
||||
|
||||
commit 34ca7d26830b5c58a35b9aec7f7cdd6d4446c456
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Tue Sep 30 00:30:24 2008 +0200
|
||||
|
||||
Do not accept fewer values anymore when setting properties
|
||||
|
||||
Supplied number of values have to match the numbers of axes/buttons exactly. Fewer values are not accepted
|
||||
anymore, because the omitted information get lost. That way we ensure that the properties are always complete
|
||||
when requested by clients.
|
||||
|
||||
commit e1c3b5e3041c2fda5d4080f24aa988399cb793bd
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Tue Sep 30 00:17:41 2008 +0200
|
||||
|
||||
Exporting num_axes values instead of MAXAXES
|
||||
|
||||
Only export the number of axes/buttons in properties that we actually have.
|
||||
No need to export MAXAXES values, if we don't support them.
|
||||
|
||||
commit ab79083b13bcf2810f57ae26444d179f6323ec03
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Tue Sep 30 00:01:38 2008 +0200
|
||||
|
||||
Save probed number of axes/buttons for joystick backend
|
||||
|
||||
commit e8432b7f8e8c515faa55d25f6028b7e5e7ce9c7c
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Tue Sep 30 00:01:16 2008 +0200
|
||||
|
||||
Probed number of buttons shall not exceed MAXBUTTONS
|
||||
|
||||
Same for axes.
|
||||
|
||||
commit 06c607ebc10945342728dd3552eee6b894f55c51
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Mon Sep 29 23:47:53 2008 +0200
|
||||
|
||||
Compile fix on BSD
|
||||
|
||||
commit f4be58b1ea017d5f17aeba228b53c30a1f8609bf
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Mon Sep 29 23:36:12 2008 +0200
|
||||
|
||||
Probe device once on INIT and re-use found information.
|
||||
|
||||
Makes reopening a device on vt-enter much smoother and throws less warnings.
|
||||
Remember number of found axes and buttons.
|
||||
|
||||
commit b56085c73d8780d8353380ecbc4b9cdb3f085b2f
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Mon Sep 29 22:56:29 2008 +0200
|
||||
|
||||
Export number of configurable buttons/axes as readonly properties.
|
||||
|
||||
This number does not need to match the number of valuators/buttons.
|
||||
|
||||
commit ebf31b61b3d1d9ad0048429a75b99bf5952ad6b8
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sun Sep 28 16:41:17 2008 +0200
|
||||
|
||||
jstk_key.c: missing include
|
||||
|
||||
xf86optionListDup is defined in xf86Optrec.h
|
||||
|
||||
commit 3794afd9784480fa503cbffa16382c0e38e1fa8b
|
||||
Author: Peter Hutterer <peter.hutterer@redhat.com>
|
||||
Date: Fri Sep 26 17:19:29 2008 +0930
|
||||
|
||||
Adjust joystick properties to new property API.
|
||||
|
||||
ConfigureProperty doesn't exist anymore, ChangeProperty has two parameters
|
||||
less. SetProperty handler must return Status.
|
||||
Mark all properties as non-deletable.
|
||||
|
||||
commit 6e635e394a7423734d36d99dc744203b759a8d42
|
||||
Merge: f04e3c8 a1b87df
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Tue Sep 16 20:58:40 2008 +0200
|
||||
|
||||
Merge branch 'input-properties'
|
||||
|
||||
Conflicts:
|
||||
src/jstk.h
|
||||
src/jstk_key.c
|
||||
|
||||
commit a1b87df15dd2ad2a5593fed198b32053be5825cc
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Mon Sep 15 19:29:07 2008 +0200
|
||||
|
||||
Set type_name of slave keyboard device to XI_JOYSTICK as well.
|
||||
|
||||
commit 57d1201f584a74b9d6822e55ff66a0786de4ea2b
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Mon Sep 15 19:27:52 2008 +0200
|
||||
|
||||
Set type_name to XI_JOYSTICK. Let's not claim we are XI_MOUSE.
|
||||
|
||||
commit f04e3c822229b51e5a4048d7e91fa34f69e361e9
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Mon Sep 15 19:24:40 2008 +0200
|
||||
|
||||
Set type_name to XI_JOYSTICK. Let's not claim we are XI_MOUSE.
|
||||
|
||||
commit 282fc3068ed734e099efe272c740e6c8e5495176
|
||||
Author: Christoph Brill <egore911@egore911.de>
|
||||
Date: Sun Sep 7 11:11:50 2008 +0200
|
||||
|
||||
Make "less joystick.man" work
|
||||
|
||||
commit 838dfffe9833b52626d5a528fc08d2838438ee46
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sat Sep 6 19:05:29 2008 +0200
|
||||
|
||||
Initialize PtrFeedbackClassDeviceStruct for pointer device
|
||||
|
||||
commit f691491bc96d1c7944f4036dde4090f11066aea4
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sat Sep 6 19:03:52 2008 +0200
|
||||
|
||||
Silence warning about implicit cast
|
||||
|
||||
commit 911986c4c702979fe48d3a2c18e238710a513449
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sat Sep 6 17:26:32 2008 +0200
|
||||
|
||||
Always add second input device for keys only
|
||||
|
||||
Having one device for both mouse and keyboard events breaks with MPX and custom keymaps, because the keymap is
|
||||
copied to the core pointer instead of the core keyboard.
|
||||
|
||||
Easiest fix for that is to have two separate input devices. One single instance of the driver will now create
|
||||
a second input device that has only keyboard capabilities. It shares all the config with the master and will
|
||||
be removed when the master device is removed.
|
||||
|
||||
The creation of this second device is a little hack-ish. I hope things are done right.
|
||||
|
||||
commit 5a3ecea272a980df0ac4c40826cf095399e7b022
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sat Sep 6 13:08:51 2008 +0200
|
||||
|
||||
make dist hook: git-log > git log
|
||||
|
||||
I somehow don't have those nice aliases. This should make it work on every system.
|
||||
|
||||
commit 9d42b7f972f58a7cf97b8a57e1b6b85984c6476a
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sat Sep 6 12:58:41 2008 +0200
|
||||
|
||||
Update man page concerning custom driver options through hal
|
||||
|
||||
Warning is obsoleted by xorg-server-1.5
|
||||
|
||||
commit 235f5d12489f5f5f662e8f7b617108a01fdffed0
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sat Sep 6 12:55:08 2008 +0200
|
||||
|
||||
Bump to 1.3.3
|
||||
|
||||
commit 30333076a39dd50e6356789cd03c49712b43427c
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sat Sep 6 12:40:12 2008 +0200
|
||||
|
||||
Add ChangeLog to .gitignore
|
||||
|
||||
commit 579670d163d7ab2623d975ac85f6626a5499bf32
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sat Sep 6 12:39:12 2008 +0200
|
||||
|
||||
Remove duplicated code in jstkInitKeys
|
||||
|
||||
Too much copy'n'paste
|
||||
|
||||
commit 17c4f79d50ab69f954fec5a8daa327c4a1a64597
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sat Sep 6 12:38:16 2008 +0200
|
||||
|
||||
Adding empty ctrlProc to prevent crashing of X when running without XKB
|
||||
|
||||
X calls ctrlProc without checks for NULL in some places, especially when running "X -kb". Adding
|
||||
that function back to be safe.
|
||||
|
||||
commit ea36125872ad4411f3529392761bff6e35006ce4
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Mon Sep 1 00:05:07 2008 +0200
|
||||
|
||||
Adding empty ctrlProc to prevent crashing of X when running without XKB
|
||||
|
||||
X calls ctrlProc without checks for NULL in some places, especially when running "X -kb". Adding
|
||||
that function back to be safe.
|
||||
|
||||
commit c39d709366332bd2d1ef306a0b801333f6cd3f7a
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sun Aug 31 19:24:38 2008 +0200
|
||||
|
||||
Remove duplicated code in jstkInitKeys
|
||||
|
||||
Too much copy'n'paste
|
||||
|
||||
commit 28c1dad7be2419a1ffa7b5f0897e88a1ccac36f5
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sun Aug 31 00:42:39 2008 +0200
|
||||
|
||||
Added valid-values-information to properties
|
||||
|
||||
Show user, what cryptic numbers are valid for axis type, axis mapping and button mapping.
|
||||
|
||||
commit eb866c65372fd880e5ffa80318cdb6dcf8c86e30
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sun Aug 31 00:30:11 2008 +0200
|
||||
|
||||
Typo in valid values for property "Generate Key Events"
|
||||
|
||||
commit 63fd6fdd9c012e0017e310d22cfcb45a2a741547
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sun Aug 31 00:28:37 2008 +0200
|
||||
|
||||
Property support for axis type, axis mapping and button mapping
|
||||
|
||||
Added prototypes for unimplemented properties.
|
||||
|
||||
commit 13813e0982e5274e2ef6d9ea167ebffbea9dbd9c
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sat Aug 23 23:38:57 2008 +0200
|
||||
|
||||
Add ChangeLog to .gitignore
|
||||
|
||||
commit 0410505147a416844fae6dcf6f9ea782f1b74863
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sat Aug 23 23:31:33 2008 +0200
|
||||
|
||||
Expose device properties for mouse_enabled, keys_enabled and axes deadzones.
|
||||
|
||||
Deadzones takes up to MAXAXES 32 bit numbers. If only one value is supplied, it is applied to all axes the same. If multiple values are
|
||||
supplied, they are applied to the axis they stand for, all other values are untouched.
|
||||
|
||||
commit e64b4ebcd121a9080d1da39e5037182df7edfdbb
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sat Aug 23 22:02:54 2008 +0200
|
||||
|
||||
Add support for device properties.
|
||||
|
||||
Only exported property for now is DebugLevel.
|
||||
|
||||
commit 5e91f0bdd4fa529d1d5f0f8ffc87aaf9fbec2a88
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sat Aug 23 21:18:41 2008 +0200
|
||||
|
||||
Remove stale comment
|
||||
|
||||
commit a4d96de5fdbeedec1f196c2b5f4e5b498bf8e31f
|
||||
Author: Matthieu Herrb <matthieu.herrb@laas.fr>
|
||||
Date: Sat Aug 23 17:01:40 2008 +0200
|
||||
|
||||
Fix check for BSD dev/usb/usbhid.h (needs dev/usb/usb.h).
|
||||
|
||||
commit 7d6f9a32ab7e6e3e8d241fa3a230ffcf91dec468
|
||||
Author: Peter Hutterer <peter.hutterer@redhat.com>
|
||||
Date: Thu Aug 14 15:41:37 2008 +0930
|
||||
|
||||
Fix build. xf86Version.h -> xorgVersion.h
|
||||
|
||||
commit 1d67c9d801a6304267f8a821af13328fda95e497
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Thu Jun 19 11:10:02 2008 +0200
|
||||
|
||||
Added more examples for the x11_options properties of xorg-server-1.5
|
||||
|
||||
Since xorg-server-1.5 you can pass arbitrary options using the x11_options namespace. No additional
|
||||
hacks are neccessary to make hal hotplug the joystick driver.
|
||||
|
||||
commit 10203ddef9adbd27f2a9ac51d98703308f86d982
|
||||
Author: Peter Hutterer <peter@cs.unisa.edu.au>
|
||||
Date: Mon May 26 22:09:32 2008 +0930
|
||||
|
||||
Check for XINPUT ABI 3.
|
||||
|
||||
commit 0961ffa84825f3f32d9c973f054400ab9d2b7c08
|
||||
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
|
||||
Date: Sun Apr 27 19:16:29 2008 +0200
|
||||
|
@ -19,15 +19,18 @@
|
||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
SUBDIRS = src man config
|
||||
DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir=\$${includedir}/xorg
|
||||
SUBDIRS = src man config include
|
||||
|
||||
EXTRA_DIST = autogen.sh ChangeLog
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = xorg-joystick.pc
|
||||
|
||||
CLEANFILES = ChangeLog
|
||||
EXTRA_DIST = ChangeLog
|
||||
MAINTAINERCLEANFILES = ChangeLog
|
||||
|
||||
.PHONY: ChangeLog
|
||||
|
||||
ChangeLog:
|
||||
(GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
|
||||
$(CHANGELOG_CMD)
|
||||
|
||||
dist-hook: ChangeLog
|
||||
|
@ -33,6 +33,7 @@
|
||||
# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
@ -55,10 +56,11 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
$(top_srcdir)/configure COPYING ChangeLog config.guess \
|
||||
config.sub depcomp install-sh ltmain.sh missing
|
||||
$(srcdir)/xorg-joystick.pc.in $(top_srcdir)/configure COPYING \
|
||||
ChangeLog config.guess config.sub depcomp install-sh ltmain.sh \
|
||||
missing
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
@ -68,7 +70,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno configure.status.lineno
|
||||
mkinstalldirs = $(SHELL) $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_FILES = xorg-joystick.pc
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
@ -77,6 +79,15 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
install-recursive installcheck-recursive installdirs-recursive \
|
||||
pdf-recursive ps-recursive uninstall-info-recursive \
|
||||
uninstall-recursive
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
|
||||
pkgconfigDATA_INSTALL = $(INSTALL_DATA)
|
||||
DATA = $(pkgconfig_DATA)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
@ -90,7 +101,6 @@ am__remove_distdir = \
|
||||
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
|
||||
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
|
||||
@ -109,8 +119,10 @@ BSD_BACKEND_TRUE = @BSD_BACKEND_TRUE@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CHANGELOG_CMD = @CHANGELOG_CMD@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CWARNFLAGS = @CWARNFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
@ -136,6 +148,7 @@ F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
FILE_MAN_DIR = @FILE_MAN_DIR@
|
||||
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
|
||||
GREP = @GREP@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
@ -174,15 +187,9 @@ STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
XORG_CFLAGS = @XORG_CFLAGS@
|
||||
XORG_LIBS = @XORG_LIBS@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_NMEDIT = @ac_ct_NMEDIT@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
@ -199,32 +206,44 @@ build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
distcleancheck_listfiles = @distcleancheck_listfiles@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
inputdir = @inputdir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sdkdir = @sdkdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
SUBDIRS = src man config
|
||||
EXTRA_DIST = autogen.sh ChangeLog
|
||||
CLEANFILES = ChangeLog
|
||||
DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir=\$${includedir}/xorg
|
||||
SUBDIRS = src man config include
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = xorg-joystick.pc
|
||||
EXTRA_DIST = ChangeLog
|
||||
MAINTAINERCLEANFILES = ChangeLog
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
@ -279,6 +298,8 @@ $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
xorg-joystick.pc: $(top_builddir)/config.status $(srcdir)/xorg-joystick.pc.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
@ -289,6 +310,23 @@ clean-libtool:
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
install-pkgconfigDATA: $(pkgconfig_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(pkgconfigdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfigdir)"
|
||||
@list='$(pkgconfig_DATA)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
|
||||
$(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-pkgconfigDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkgconfig_DATA)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
|
||||
done
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
@ -425,6 +463,7 @@ distclean-tags:
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
mkdir $(distdir)
|
||||
$(mkdir_p) $(distdir)/.
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
@ -568,9 +607,12 @@ distcleancheck: distclean
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile config.h
|
||||
all-am: Makefile $(DATA) config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
@ -588,7 +630,6 @@ install-strip:
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
@ -596,6 +637,7 @@ distclean-generic:
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
@ -616,7 +658,7 @@ info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
install-data-am: install-pkgconfigDATA
|
||||
|
||||
install-exec-am:
|
||||
|
||||
@ -644,7 +686,7 @@ ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
uninstall-am: uninstall-info-am uninstall-pkgconfigDATA
|
||||
|
||||
uninstall-info: uninstall-info-recursive
|
||||
|
||||
@ -657,17 +699,19 @@ uninstall-info: uninstall-info-recursive
|
||||
distuninstallcheck dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-exec \
|
||||
install-exec-am install-info install-info-am install-man \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
maintainer-clean-recursive mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
|
||||
tags tags-recursive uninstall uninstall-am uninstall-info-am
|
||||
install-pkgconfigDATA install-strip installcheck \
|
||||
installcheck-am installdirs installdirs-am maintainer-clean \
|
||||
maintainer-clean-generic maintainer-clean-recursive \
|
||||
mostlyclean mostlyclean-generic mostlyclean-libtool \
|
||||
mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
|
||||
uninstall uninstall-am uninstall-info-am \
|
||||
uninstall-pkgconfigDATA
|
||||
|
||||
|
||||
.PHONY: ChangeLog
|
||||
|
||||
ChangeLog:
|
||||
(GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
|
||||
$(CHANGELOG_CMD)
|
||||
|
||||
dist-hook: ChangeLog
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
|
20
driver/xf86-input-joystick/README
Normal file
20
driver/xf86-input-joystick/README
Normal file
@ -0,0 +1,20 @@
|
||||
xf86-input-joystick - Joystick input driver for the Xorg X server
|
||||
|
||||
Please submit bugs & patches to the Xorg bugzilla:
|
||||
|
||||
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
|
||||
|
||||
All questions regarding this software should be directed at the
|
||||
Xorg mailing list:
|
||||
|
||||
http://lists.freedesktop.org/mailman/listinfo/xorg
|
||||
|
||||
The master development code repository can be found at:
|
||||
|
||||
git://anongit.freedesktop.org/git/xorg/driver/xf86-input-joystick
|
||||
|
||||
http://cgit.freedesktop.org/xorg/driver/xf86-input-joystick
|
||||
|
||||
For more information on the git code manager, see:
|
||||
|
||||
http://wiki.x.org/wiki/GitPage
|
155
driver/xf86-input-joystick/aclocal.m4
vendored
155
driver/xf86-input-joystick/aclocal.m4
vendored
@ -7631,6 +7631,7 @@ AC_SUBST([am__tar])
|
||||
AC_SUBST([am__untar])
|
||||
]) # _AM_PROG_TAR
|
||||
|
||||
dnl xorg-macros.m4. Generated from xorg-macros.m4.in:xorgversion.m4 by configure.
|
||||
dnl
|
||||
dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
|
||||
dnl
|
||||
@ -7678,7 +7679,7 @@ AC_DEFUN([XORG_MACROS_VERSION],[
|
||||
XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
|
||||
XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
|
||||
AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
|
||||
[XORG_MACROS_version=1.1.6
|
||||
[XORG_MACROS_version=1.2.1
|
||||
XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
|
||||
XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
|
||||
if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
|
||||
@ -7712,6 +7713,10 @@ else
|
||||
if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
|
||||
RAWCPPFLAGS=-undef
|
||||
AC_MSG_RESULT([yes])
|
||||
# under Cygwin unix is still defined even with -undef
|
||||
elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
|
||||
RAWCPPFLAGS="-undef -ansi"
|
||||
AC_MSG_RESULT([yes, with -ansi])
|
||||
else
|
||||
AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
|
||||
fi
|
||||
@ -7824,7 +7829,9 @@ AC_SUBST([ADMIN_MAN_DIR])
|
||||
# Whether or not the necessary tools and files are found can be checked
|
||||
# with the AM_CONDITIONAL "BUILD_LINUXDOC"
|
||||
AC_DEFUN([XORG_CHECK_LINUXDOC],[
|
||||
XORG_SGML_PATH=$prefix/share/sgml
|
||||
if test x$XORG_SGML_PATH = x ; then
|
||||
XORG_SGML_PATH=$prefix/share/sgml
|
||||
fi
|
||||
HAVE_DEFS_ENT=
|
||||
|
||||
if test x"$cross_compiling" = x"yes" ; then
|
||||
@ -7880,7 +7887,9 @@ AC_SUBST(MAKE_HTML)
|
||||
# indicates whether the necessary tools and files are found and, if set,
|
||||
# $(MAKE_XXX) blah.sgml will produce blah.xxx.
|
||||
AC_DEFUN([XORG_CHECK_DOCBOOK],[
|
||||
XORG_SGML_PATH=$prefix/share/sgml
|
||||
if test x$XORG_SGML_PATH = x ; then
|
||||
XORG_SGML_PATH=$prefix/share/sgml
|
||||
fi
|
||||
HAVE_DEFS_ENT=
|
||||
BUILDTXTDOC=no
|
||||
BUILDPDFDOC=no
|
||||
@ -8057,55 +8066,31 @@ AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
|
||||
|
||||
]) # XORG_LINT_LIBRARY
|
||||
|
||||
dnl Copyright 2005 Red Hat, Inc
|
||||
dnl
|
||||
dnl Permission to use, copy, modify, distribute, and sell this software and its
|
||||
dnl documentation for any purpose is hereby granted without fee, provided that
|
||||
dnl the above copyright notice appear in all copies and that both that
|
||||
dnl copyright notice and this permission notice appear in supporting
|
||||
dnl documentation.
|
||||
dnl
|
||||
dnl The above copyright notice and this permission notice shall be included
|
||||
dnl in all copies or substantial portions of the Software.
|
||||
dnl
|
||||
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
dnl OTHER DEALINGS IN THE SOFTWARE.
|
||||
dnl
|
||||
dnl Except as contained in this notice, the name of the copyright holders shall
|
||||
dnl not be used in advertising or otherwise to promote the sale, use or
|
||||
dnl other dealings in this Software without prior written authorization
|
||||
dnl from the copyright holders.
|
||||
dnl
|
||||
|
||||
# XORG_DRIVER_CHECK_EXT()
|
||||
# --------------------------
|
||||
# Checks for the $1 define in xorg-server.h (from the sdk). If it
|
||||
# is defined, then add $1 to $REQUIRED_MODULES.
|
||||
|
||||
AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
|
||||
SAVE_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include "xorg-server.h"
|
||||
#if !defined $1
|
||||
#error $1 not defined
|
||||
#endif
|
||||
]])],
|
||||
[_EXT_CHECK=yes],
|
||||
[_EXT_CHECK=no])
|
||||
CFLAGS="$SAVE_CFLAGS"
|
||||
AC_MSG_CHECKING([if $1 is defined])
|
||||
AC_MSG_RESULT([$_EXT_CHECK])
|
||||
if test "$_EXT_CHECK" != no; then
|
||||
REQUIRED_MODULES="$REQUIRED_MODULES $2"
|
||||
fi
|
||||
])
|
||||
|
||||
# XORG_CWARNFLAGS
|
||||
# ---------------
|
||||
# Minimum version: 1.2.0
|
||||
#
|
||||
# Defines CWARNFLAGS to enable C compiler warnings.
|
||||
#
|
||||
AC_DEFUN([XORG_CWARNFLAGS], [
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
if test "x$GCC" = xyes ; then
|
||||
CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
|
||||
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
|
||||
-Wbad-function-cast"
|
||||
case `gcc -dumpversion` in
|
||||
3.4.* | 4.*)
|
||||
CWARNFLAGS+=" -Wold-style-definition -Wdeclaration-after-statement"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
|
||||
if test "x$SUNCC" = "xyes"; then
|
||||
CWARNFLAGS="-v"
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(CWARNFLAGS)
|
||||
]) # XORG_CWARNFLAGS
|
||||
dnl Copyright 2005 Red Hat, Inc
|
||||
dnl
|
||||
dnl Permission to use, copy, modify, distribute, and sell this software and its
|
||||
@ -8168,3 +8153,69 @@ AC_DEFUN([XORG_RELEASE_VERSION],[
|
||||
[Patch version of this package])
|
||||
])
|
||||
|
||||
# XORG_CHANGELOG()
|
||||
# ----------------
|
||||
# Minimum version: 1.2.0
|
||||
#
|
||||
# Defines the variable CHANGELOG_CMD as the command to generate
|
||||
# ChangeLog from git.
|
||||
#
|
||||
# Arrange that distcleancheck ignores ChangeLog left over by distclean.
|
||||
#
|
||||
AC_DEFUN([XORG_CHANGELOG], [
|
||||
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
|
||||
mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
|
||||
echo 'git directory not found: installing possibly empty changelog.' >&2)"
|
||||
AC_SUBST([CHANGELOG_CMD])
|
||||
AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
|
||||
]) # XORG_CHANGELOG
|
||||
|
||||
dnl Copyright 2005 Red Hat, Inc
|
||||
dnl
|
||||
dnl Permission to use, copy, modify, distribute, and sell this software and its
|
||||
dnl documentation for any purpose is hereby granted without fee, provided that
|
||||
dnl the above copyright notice appear in all copies and that both that
|
||||
dnl copyright notice and this permission notice appear in supporting
|
||||
dnl documentation.
|
||||
dnl
|
||||
dnl The above copyright notice and this permission notice shall be included
|
||||
dnl in all copies or substantial portions of the Software.
|
||||
dnl
|
||||
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
dnl OTHER DEALINGS IN THE SOFTWARE.
|
||||
dnl
|
||||
dnl Except as contained in this notice, the name of the copyright holders shall
|
||||
dnl not be used in advertising or otherwise to promote the sale, use or
|
||||
dnl other dealings in this Software without prior written authorization
|
||||
dnl from the copyright holders.
|
||||
dnl
|
||||
|
||||
# XORG_DRIVER_CHECK_EXT()
|
||||
# --------------------------
|
||||
# Checks for the $1 define in xorg-server.h (from the sdk). If it
|
||||
# is defined, then add $1 to $REQUIRED_MODULES.
|
||||
|
||||
AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
|
||||
SAVE_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include "xorg-server.h"
|
||||
#if !defined $1
|
||||
#error $1 not defined
|
||||
#endif
|
||||
]])],
|
||||
[_EXT_CHECK=yes],
|
||||
[_EXT_CHECK=no])
|
||||
CFLAGS="$SAVE_CFLAGS"
|
||||
AC_MSG_CHECKING([if $1 is defined])
|
||||
AC_MSG_RESULT([$_EXT_CHECK])
|
||||
if test "$_EXT_CHECK" != no; then
|
||||
REQUIRED_MODULES="$REQUIRED_MODULES $2"
|
||||
fi
|
||||
])
|
||||
|
||||
|
@ -1,12 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
srcdir=`dirname $0`
|
||||
test -z "$srcdir" && srcdir=.
|
||||
|
||||
ORIGDIR=`pwd`
|
||||
cd $srcdir
|
||||
|
||||
autoreconf -v --install || exit 1
|
||||
cd $ORIGDIR || exit $?
|
||||
|
||||
$srcdir/configure --enable-maintainer-mode "$@"
|
@ -17,6 +17,9 @@
|
||||
/* Define to 1 if you have the <dev/usb/usb.h> header file. */
|
||||
#undef HAVE_DEV_USB_USB_H
|
||||
|
||||
/* Define to 1 if you have the <dev/usb/usb_ioctl.h> header file. */
|
||||
#undef HAVE_DEV_USB_USB_IOCTL_H
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
|
@ -4,12 +4,43 @@
|
||||
<match key="info.capabilities" contains="input">
|
||||
<!-- Match on anything you like from lshal -->
|
||||
<match key="input.product" string="Logitech Logitech Dual Action">
|
||||
<!-- Currently Xorg looks for these two capabilities, so
|
||||
we need to add them. This might confuse other hal clients. -->
|
||||
<append key="info.capabilities" type="strlist">input.keys</append>
|
||||
<append key="info.capabilities" type="strlist">input.mouse</append>
|
||||
<!-- xorg-server<1.5 will only hotplug devices where these two capatilities
|
||||
are set. This hack can confuse other hal clients. -->
|
||||
<!--
|
||||
<append key="info.capabilities" type="strlist">input.keys</append>
|
||||
<append key="info.capabilities" type="strlist">input.mouse</append>
|
||||
-->
|
||||
|
||||
<merge key="input.x11_driver" type="string">joystick</merge>
|
||||
<!-- How to add custom parameters to configure the device? -->
|
||||
|
||||
<!-- Arbitrary options can be passed to the driver using
|
||||
the input.x11_options property since xorg-server-1.5. -->
|
||||
|
||||
<!-- DEFAULT CONFIGURATION
|
||||
Change this to override the default settings of the input driver.
|
||||
-->
|
||||
<merge key="input.x11_options.MapButton1" type="string">button=1</merge>
|
||||
<merge key="input.x11_options.MapButton2" type="string">button=2</merge>
|
||||
<merge key="input.x11_options.MapButton3" type="string">button=3</merge>
|
||||
|
||||
<merge key="input.x11_options.MapAxis1" type="string">mode=relative axis=+1x deadzone=5000</merge>
|
||||
<merge key="input.x11_options.MapAxis2" type="string">mode=relative axis=+1y deadzone=5000</merge>
|
||||
<merge key="input.x11_options.MapAxis3" type="string">mode=relative axis=+1zx deadzone=5000</merge>
|
||||
<merge key="input.x11_options.MapAxis4" type="string">mode=relative axis=+1zy deadzone=5000</merge>
|
||||
<merge key="input.x11_options.MapAxis5" type="string">mode=accelerated axis=+1x deadzone=5000</merge>
|
||||
<merge key="input.x11_options.MapAxis6" type="string">mode=accelerated axis=+1y deadzone=5000</merge>
|
||||
|
||||
<!-- EXAMPLES
|
||||
<merge key="input.x11_options.DebugLevel" type="string">5</merge>
|
||||
<merge key="input.x11_options.AutoRepeat" type="string">500 4</merge>
|
||||
<merge key="input.x11_options.MapButton4" type="string">key=Alt_L+Tab</merge>
|
||||
<merge key="input.x11_options.MapButton8" type="string">amplify=0.3</merge>
|
||||
<merge key="input.x11_options.MapButton9" type="string">disable-mouse</merge>
|
||||
<merge key="input.x11_options.MapButton10" type="string">key=space</merge>
|
||||
|
||||
<merge key="input.x11_options.MapAxis1" type="string">mode=accelerated keylow=Left keyhigh=Right</merge>
|
||||
<merge key="input.x11_options.MapAxis2" type="string">mode=accelerated keylow=Up keyhigh=Down</merge>
|
||||
-->
|
||||
</match>
|
||||
</match>
|
||||
</device>
|
||||
|
@ -65,8 +65,10 @@ BSD_BACKEND_TRUE = @BSD_BACKEND_TRUE@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CHANGELOG_CMD = @CHANGELOG_CMD@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CWARNFLAGS = @CWARNFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
@ -92,6 +94,7 @@ F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
FILE_MAN_DIR = @FILE_MAN_DIR@
|
||||
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
|
||||
GREP = @GREP@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
@ -130,15 +133,9 @@ STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
XORG_CFLAGS = @XORG_CFLAGS@
|
||||
XORG_LIBS = @XORG_LIBS@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_NMEDIT = @ac_ct_NMEDIT@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
@ -155,25 +152,34 @@ build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
distcleancheck_listfiles = @distcleancheck_listfiles@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
inputdir = @inputdir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sdkdir = @sdkdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
|
10078
driver/xf86-input-joystick/configure
vendored
10078
driver/xf86-input-joystick/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -22,7 +22,7 @@
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
AC_INIT([xf86-input-joystick],
|
||||
1.3.2,
|
||||
1.4.1,
|
||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
|
||||
xf86-input-joystick)
|
||||
|
||||
@ -32,15 +32,16 @@ AM_INIT_AUTOMAKE([dist-bzip2])
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
DRIVER_NAME=joystick
|
||||
AC_SUBST([DRIVER_NAME])
|
||||
|
||||
# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG
|
||||
m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])])
|
||||
XORG_MACROS_VERSION(1.2)
|
||||
AM_CONFIG_HEADER([config.h])
|
||||
|
||||
# Checks for programs.
|
||||
AC_DISABLE_STATIC
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_CC
|
||||
XORG_CWARNFLAGS
|
||||
|
||||
AH_TOP([#include "xorg-server.h"])
|
||||
|
||||
@ -66,17 +67,19 @@ inputdir=${moduledir}/input
|
||||
AC_SUBST(inputdir)
|
||||
|
||||
# Checks for extensions
|
||||
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
|
||||
XORG_DRIVER_CHECK_EXT(XINPUT, inputproto)
|
||||
XORG_DRIVER_CHECK_EXT(XKB, kbproto)
|
||||
|
||||
# Checks for pkg-config packages
|
||||
PKG_CHECK_MODULES(XORG,
|
||||
[xorg-server >= 1.3.99.901] xproto $REQUIRED_MODULES)
|
||||
sdkdir=$(pkg-config --variable=sdkdir xorg-server)
|
||||
|
||||
CFLAGS="$CFLAGS $XORG_CFLAGS "' -I$(top_srcdir)/src'
|
||||
AC_SUBST([CFLAGS])
|
||||
[xorg-server >= 1.3.99.901 xorg-server <= 1.6.99] xproto $REQUIRED_MODULES)
|
||||
XORG_CFLAGS="$CWARNFLAGS $XORG_CFLAGS"
|
||||
xorg_sdkdir=$(pkg-config --variable=sdkdir xorg-server)
|
||||
AC_ARG_WITH(sdkdir,
|
||||
AC_HELP_STRING([--with-sdkdir=<path>],
|
||||
[Xorg X Server sdk headers (default is autodetected)]),
|
||||
[sdkdir="$withval"], [sdkdir="${xorg_sdkdir}"])
|
||||
AC_SUBST(sdkdir)
|
||||
|
||||
# Checks for libraries.
|
||||
|
||||
@ -98,6 +101,7 @@ AC_CHECK_HEADERS([usbhid.h dev/usb/usbhid.h],, [bsd_backend=no],
|
||||
AC_CHECK_LIB([usbhid],[hid_get_item],, [bsd_backend=no])
|
||||
AM_CONDITIONAL(BSD_BACKEND, [test "x$bsd_backend" = xyes])
|
||||
if test "x$bsd_backend" = xyes; then
|
||||
AC_CHECK_HEADERS([dev/usb/usb_ioctl.h])
|
||||
AC_DEFINE(BSD_BACKEND, 1, [Compile BSD usbhid backend])
|
||||
fi
|
||||
|
||||
@ -110,10 +114,19 @@ fi
|
||||
|
||||
AC_HEADER_STDC
|
||||
|
||||
DRIVER_NAME=joystick
|
||||
AC_SUBST([DRIVER_NAME])
|
||||
|
||||
XORG_MANPAGE_SECTIONS
|
||||
XORG_RELEASE_VERSION
|
||||
XORG_CHANGELOG
|
||||
|
||||
AC_OUTPUT([Makefile src/Makefile man/Makefile config/Makefile])
|
||||
AC_OUTPUT([Makefile
|
||||
src/Makefile
|
||||
man/Makefile
|
||||
config/Makefile
|
||||
include/Makefile
|
||||
xorg-joystick.pc])
|
||||
|
||||
echo
|
||||
echo Building Linux joystick backend: $linux_backend
|
||||
|
23
driver/xf86-input-joystick/include/Makefile.am
Normal file
23
driver/xf86-input-joystick/include/Makefile.am
Normal file
@ -0,0 +1,23 @@
|
||||
# Copyright 2008 Sascha Hlusiak
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
# license, and/or sell copies of the Software, and to permit persons to whom
|
||||
# the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
# SASCHA HLUSIAK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
EXTRA_DIST = joystick-properties.h
|
||||
|
||||
sdk_HEADERS = joystick-properties.h
|
447
driver/xf86-input-joystick/include/Makefile.in
Normal file
447
driver/xf86-input-joystick/include/Makefile.in
Normal file
@ -0,0 +1,447 @@
|
||||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
# Copyright 2008 Sascha Hlusiak
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
# license, and/or sell copies of the Software, and to permit persons to whom
|
||||
# the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
# SASCHA HLUSIAK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = include
|
||||
DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(sdkdir)"
|
||||
sdkHEADERS_INSTALL = $(INSTALL_HEADER)
|
||||
HEADERS = $(sdk_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
|
||||
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
APP_MAN_DIR = @APP_MAN_DIR@
|
||||
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BSD_BACKEND_FALSE = @BSD_BACKEND_FALSE@
|
||||
BSD_BACKEND_TRUE = @BSD_BACKEND_TRUE@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CHANGELOG_CMD = @CHANGELOG_CMD@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CWARNFLAGS = @CWARNFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEBUG_FALSE = @DEBUG_FALSE@
|
||||
DEBUG_TRUE = @DEBUG_TRUE@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
|
||||
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
|
||||
DRIVER_NAME = @DRIVER_NAME@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EVDEV_BACKEND_FALSE = @EVDEV_BACKEND_FALSE@
|
||||
EVDEV_BACKEND_TRUE = @EVDEV_BACKEND_TRUE@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
FILE_MAN_DIR = @FILE_MAN_DIR@
|
||||
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
|
||||
GREP = @GREP@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIB_MAN_DIR = @LIB_MAN_DIR@
|
||||
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
|
||||
LINUX_BACKEND_FALSE = @LINUX_BACKEND_FALSE@
|
||||
LINUX_BACKEND_TRUE = @LINUX_BACKEND_TRUE@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MISC_MAN_DIR = @MISC_MAN_DIR@
|
||||
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
XORG_CFLAGS = @XORG_CFLAGS@
|
||||
XORG_LIBS = @XORG_LIBS@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
distcleancheck_listfiles = @distcleancheck_listfiles@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
inputdir = @inputdir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sdkdir = @sdkdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
EXTRA_DIST = joystick-properties.h
|
||||
sdk_HEADERS = joystick-properties.h
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu include/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
install-sdkHEADERS: $(sdk_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(sdkdir)" || $(mkdir_p) "$(DESTDIR)$(sdkdir)"
|
||||
@list='$(sdk_HEADERS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(sdkHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(sdkdir)/$$f'"; \
|
||||
$(sdkHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(sdkdir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-sdkHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(sdk_HEADERS)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(sdkdir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(sdkdir)/$$f"; \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(sdkdir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-libtool \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-sdkHEADERS
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-sdkHEADERS
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool ctags distclean distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-exec install-exec-am install-info \
|
||||
install-info-am install-man install-sdkHEADERS install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am uninstall-info-am uninstall-sdkHEADERS
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
123
driver/xf86-input-joystick/include/joystick-properties.h
Normal file
123
driver/xf86-input-joystick/include/joystick-properties.h
Normal file
@ -0,0 +1,123 @@
|
||||
/*
|
||||
* Copyright 2007-2008 by Sascha Hlusiak. <saschahlusiak@freedesktop.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Sascha Hlusiak not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. Sascha Hlusiak makes no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _JOYSTICK_PROPERTIES_
|
||||
#define _JOYSTICK_PROPERTIES_
|
||||
|
||||
/**
|
||||
* Properties exported by the joystick driver. These properties are
|
||||
* recognized by the driver and will change its behavior when modified.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/** To be used with property JSTK_PROP_AXIS_TYPE **/
|
||||
typedef enum _JSTK_TYPE {
|
||||
JSTK_TYPE_NONE=0, /* Axis value is not relevant */
|
||||
JSTK_TYPE_BYVALUE, /* Speed of cursor is relative to amplitude */
|
||||
JSTK_TYPE_ACCELERATED, /* Speed is accelerated */
|
||||
JSTK_TYPE_ABSOLUTE /* The amplitude defines the cursor position */
|
||||
} JSTK_TYPE;
|
||||
|
||||
|
||||
/** To be used with properties JSTK_PROP_AXIS_MAPPING, JSTK_PROP_BUTTON_MAPPING */
|
||||
typedef enum _JSTK_MAPPING {
|
||||
JSTK_MAPPING_NONE=0, /* Nothing */
|
||||
JSTK_MAPPING_X, /* X-Axis */
|
||||
JSTK_MAPPING_Y, /* Y-Axis */
|
||||
JSTK_MAPPING_ZX, /* Horizontal scrolling */
|
||||
JSTK_MAPPING_ZY, /* Vertical scrolling */
|
||||
JSTK_MAPPING_BUTTON, /* Mouse button */
|
||||
JSTK_MAPPING_KEY, /* Keyboard event */
|
||||
JSTK_MAPPING_SPEED_MULTIPLY, /* Will amplify all axis movement */
|
||||
JSTK_MAPPING_DISABLE, /* Disable mouse and key events */
|
||||
JSTK_MAPPING_DISABLE_MOUSE, /* Disable only mouse events */
|
||||
JSTK_MAPPING_DISABLE_KEYS /* Disable only key events */
|
||||
} JSTK_MAPPING;
|
||||
|
||||
|
||||
|
||||
/** Controls the verbosity of the driver */
|
||||
/* 8 bit (0..20) */
|
||||
#define JSTK_PROP_DEBUGLEVEL "Debug Level"
|
||||
|
||||
/** Number of buttons found on device */
|
||||
/* 8 bit (0..MAXBUTTONS), read-only */
|
||||
#define JSTK_PROP_NUMBUTTONS "Buttons"
|
||||
|
||||
/** Number of axes found on device */
|
||||
/* 8 bit (0..MAXAXES), read-only */
|
||||
#define JSTK_PROP_NUMAXES "Axes"
|
||||
|
||||
/** Generate pointer movement or button events */
|
||||
/* 8 bit (0 or 1) */
|
||||
#define JSTK_PROP_MOUSE_ENABLED "Generate Mouse Events"
|
||||
|
||||
/** Generate key events */
|
||||
/* 8 bit (0 or 1) */
|
||||
#define JSTK_PROP_KEYS_ENABLED "Generate Key Events"
|
||||
|
||||
/** Set the dead zone of each axis */
|
||||
/* 32 bit (0..30000), for each axis*/
|
||||
#define JSTK_PROP_AXIS_DEADZONE "Axis Deadzone"
|
||||
|
||||
/** Set axis type to none, byvalue, accelerated, absolute */
|
||||
/* 8 bit, one of enum _JSTK_TYPE per axis*/
|
||||
#define JSTK_PROP_AXIS_TYPE "Axis Type"
|
||||
|
||||
/** Set mapping of axis to none, x, y, zx, zy, key */
|
||||
/* 8 bit, one of enum _JSTK_MAPPING per axis */
|
||||
#define JSTK_PROP_AXIS_MAPPING "Axis Mapping"
|
||||
|
||||
/** Set movement factor of axis (default 1.0f) */
|
||||
/* FLOAT[MAXAXES], movement amplify per axis */
|
||||
#define JSTK_PROP_AXIS_AMPLIFY "Axis Amplify"
|
||||
|
||||
/** Set KeySyms for axis in low position */
|
||||
/* TODO 16 bit */
|
||||
#define JSTK_PROP_AXIS_KEYS_LOW "Axis Keys (low)"
|
||||
|
||||
/** Set KeySyms for axis in high position */
|
||||
/* TODO 16 bit */
|
||||
#define JSTK_PROP_AXIS_KEYS_HIGH "Axis keys (high)"
|
||||
|
||||
/** Set the mapping of each button to
|
||||
none, x, y, zx, zy, button, key, speed_multiply,
|
||||
disable, disable_mouse, disable_keys */
|
||||
/* 8 bit, one of enum _JSTK_MAPPING per button */
|
||||
#define JSTK_PROP_BUTTON_MAPPING "Button Mapping"
|
||||
|
||||
/** Set the logical button to report for this physical button */
|
||||
/* 8 bit (0..32), logical button number per button */
|
||||
#define JSTK_PROP_BUTTON_BUTTONNUMBER "Button Number"
|
||||
|
||||
/** Set amplify factor of button (default 1.0f) */
|
||||
/* FLOAT[MAXBUTTONS], amplify value per button */
|
||||
#define JSTK_PROP_BUTTON_AMPLIFY "Button Amplify"
|
||||
|
||||
/** Set KeySyms for button */
|
||||
/* TODO 16 bit, set keysyms for button. Format: (button keysym1 keysym2 keysym3 keysym4) */
|
||||
#define JSTK_PROP_BUTTON_KEYS "Button Keys"
|
||||
|
||||
|
||||
#endif /* _JOYSTICK_PROPERTIES_ */
|
@ -2127,17 +2127,6 @@ EOF
|
||||
;;
|
||||
esac
|
||||
for pass in $passes; do
|
||||
# The preopen pass in lib mode reverses $deplibs; put it back here
|
||||
# so that -L comes before libs that need it for instance...
|
||||
if test "$linkmode,$pass" = "lib,link"; then
|
||||
## FIXME: Find the place where the list is rebuilt in the wrong
|
||||
## order, and fix it there properly
|
||||
tmp_deplibs=
|
||||
for deplib in $deplibs; do
|
||||
tmp_deplibs="$deplib $tmp_deplibs"
|
||||
done
|
||||
deplibs="$tmp_deplibs"
|
||||
fi
|
||||
if test "$linkmode,$pass" = "lib,link" ||
|
||||
test "$linkmode,$pass" = "prog,scan"; then
|
||||
libs="$deplibs"
|
||||
|
@ -101,8 +101,10 @@ BSD_BACKEND_TRUE = @BSD_BACKEND_TRUE@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CHANGELOG_CMD = @CHANGELOG_CMD@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CWARNFLAGS = @CWARNFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
@ -128,6 +130,7 @@ F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
FILE_MAN_DIR = @FILE_MAN_DIR@
|
||||
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
|
||||
GREP = @GREP@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
@ -166,15 +169,9 @@ STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
XORG_CFLAGS = @XORG_CFLAGS@
|
||||
XORG_LIBS = @XORG_LIBS@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_NMEDIT = @ac_ct_NMEDIT@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
@ -191,25 +188,34 @@ build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
distcleancheck_listfiles = @distcleancheck_listfiles@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
inputdir = @inputdir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sdkdir = @sdkdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
|
@ -1,3 +1,4 @@
|
||||
.\" shorthand for double quote that works everywhere.
|
||||
.ds q \N'34'
|
||||
.TH joystick __drivermansuffix__ __vendorversion__
|
||||
.SH NAME
|
||||
@ -127,6 +128,16 @@ Every axis which's mode is not
|
||||
.B none
|
||||
will be reported as an additional valuator.
|
||||
.TP 7
|
||||
.B \*qvaluator\*q
|
||||
Send extra valuator events for this axis. The valuators will be numbered ascending, starting with 2 (valuator 0 and 1 are reserved for pointer movement). The range of the valuators is always
|
||||
.IR -32767 " to " 32768 .
|
||||
Neither
|
||||
.B mode
|
||||
nor
|
||||
.B axis
|
||||
needs to be set to generate extra valuator events.
|
||||
Default: not set.
|
||||
.TP 7
|
||||
.BI "\*qaxis="[<factor>]<axis> \*q
|
||||
Where
|
||||
.I <axis>
|
||||
@ -163,7 +174,11 @@ If
|
||||
.B mode
|
||||
is set to
|
||||
.IR accelerated :
|
||||
One keydown event is generated, when the axis is moved out of the deadzone, the keyup event is generated, when the axis moves back to the deadzone. The keys will be autorepeated according to the keyboard settings.
|
||||
Keydown and keyup events will be generated repeatedly. The time between a keydown and a keyup event corresponds to the deflection of the axis.
|
||||
If the axis is deflected by 30%, the key will be considered to be down 300ms out of 1 second. The exact intervals may vary and can be adjusted with the
|
||||
.I amplify
|
||||
parameter. If the axis is deflected by 100%, there will only be one keydown event, so the key is considered down all the time.
|
||||
The keys will be autorepeated according to the Xorg keyboard settings.
|
||||
|
||||
See special section about key events below.
|
||||
.TP 7
|
||||
@ -302,17 +317,6 @@ and the second and fourth axis to the arrow keys
|
||||
The keys for the first two axes will be generated in an interval according to the value of the axis. The autorepeat speed of the first axis will be half the speed of that of the second axis.
|
||||
The keys for the third and fourth axis are generated once when the axis moves out of the deadzone and when it moves back into the deadzone. X.Org will autorepeat those keys according to current keyboard settings.
|
||||
|
||||
.SH "VALUATORS"
|
||||
The driver reports relative cursor movement as valuators 0 and 1.
|
||||
|
||||
Every axis will be associated with an additional valuator,
|
||||
reporting the absolute raw values of the axis in the range of
|
||||
.IR "-32768 " to " 32768" .
|
||||
|
||||
Axes in the mode
|
||||
.B "\*qnone\*q"
|
||||
will be ignored. The mode has no effect on the reported value. The axis does not need to be assigned to a direction.
|
||||
|
||||
.SH "NOTES"
|
||||
The driver does not do hotplugging on it's own. The joystick needs to be plugged in when the driver is loaded.
|
||||
If the joystick is unplugged, the device will be automatically deactivated.
|
||||
@ -321,7 +325,8 @@ There is an example hal policy in
|
||||
.I ${sourcecode}/config/50-x11-input-joystick.fdi
|
||||
which will take care of hotplugging. Place it in
|
||||
.I /etc/hal/fdi/policy
|
||||
and customize it to your needs. This is HIGHLY experimental and you can't pass any options to the driver, yet.
|
||||
and customize it to your needs. Pass custom options to the driver using x11_options properties. This requires xorg-server-1.5 or
|
||||
higher.
|
||||
.P
|
||||
Make sure you add the
|
||||
.I \*qSendCoreEvents\*q
|
||||
@ -338,7 +343,7 @@ Example:
|
||||
|
||||
|
||||
.SH "SEE ALSO"
|
||||
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__), xmodmap(1)
|
||||
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__), xmodmap(1)
|
||||
.SH AUTHORS
|
||||
Sascha Hlusiak (2007-2008),
|
||||
.fi
|
||||
|
@ -24,14 +24,19 @@
|
||||
# -avoid-version prevents gratuitous .0.0.0 version numbers on the end
|
||||
# _ladir passes a dummy rpath to libtool so the thing will actually link
|
||||
# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
|
||||
AM_CFLAGS = $(XORG_CFLAGS)
|
||||
|
||||
@DRIVER_NAME@_drv_la_LTLIBRARIES = @DRIVER_NAME@_drv.la
|
||||
@DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version
|
||||
@DRIVER_NAME@_drv_ladir = @inputdir@
|
||||
|
||||
INCLUDES=-I$(top_srcdir)/include/
|
||||
|
||||
@DRIVER_NAME@_drv_la_SOURCES = jstk.c jstk.h \
|
||||
jstk_axis.c jstk_axis.h \
|
||||
jstk_key.c jstk_key.h \
|
||||
jstk_options.c jstk_options.h \
|
||||
jstk_properties.c jstk_properties.h \
|
||||
StrKeysym.c StrKeysym.h ks_tables.h
|
||||
|
||||
BSD_SRCS = backend_bsd.c backend_bsd.h
|
||||
|
@ -81,9 +81,10 @@ LTLIBRARIES = $(@DRIVER_NAME@_drv_la_LTLIBRARIES)
|
||||
@DRIVER_NAME@_drv_la_LIBADD =
|
||||
am__@DRIVER_NAME@_drv_la_SOURCES_DIST = jstk.c jstk.h jstk_axis.c \
|
||||
jstk_axis.h jstk_key.c jstk_key.h jstk_options.c \
|
||||
jstk_options.h StrKeysym.c StrKeysym.h ks_tables.h \
|
||||
backend_bsd.c backend_bsd.h backend_joystick.c \
|
||||
backend_joystick.h backend_evdev.c backend_evdev.h
|
||||
jstk_options.h jstk_properties.c jstk_properties.h StrKeysym.c \
|
||||
StrKeysym.h ks_tables.h backend_bsd.c backend_bsd.h \
|
||||
backend_joystick.c backend_joystick.h backend_evdev.c \
|
||||
backend_evdev.h
|
||||
am__objects_1 = backend_bsd.lo
|
||||
@BSD_BACKEND_TRUE@am__objects_2 = $(am__objects_1)
|
||||
am__objects_3 = backend_joystick.lo
|
||||
@ -91,8 +92,8 @@ am__objects_3 = backend_joystick.lo
|
||||
am__objects_5 = backend_evdev.lo
|
||||
@EVDEV_BACKEND_TRUE@am__objects_6 = $(am__objects_5)
|
||||
am_@DRIVER_NAME@_drv_la_OBJECTS = jstk.lo jstk_axis.lo jstk_key.lo \
|
||||
jstk_options.lo StrKeysym.lo $(am__objects_2) $(am__objects_4) \
|
||||
$(am__objects_6)
|
||||
jstk_options.lo jstk_properties.lo StrKeysym.lo \
|
||||
$(am__objects_2) $(am__objects_4) $(am__objects_6)
|
||||
@DRIVER_NAME@_drv_la_OBJECTS = $(am_@DRIVER_NAME@_drv_la_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
@ -128,8 +129,10 @@ BSD_BACKEND_TRUE = @BSD_BACKEND_TRUE@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CHANGELOG_CMD = @CHANGELOG_CMD@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CWARNFLAGS = @CWARNFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
@ -155,6 +158,7 @@ F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
FILE_MAN_DIR = @FILE_MAN_DIR@
|
||||
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
|
||||
GREP = @GREP@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
@ -193,15 +197,9 @@ STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
XORG_CFLAGS = @XORG_CFLAGS@
|
||||
XORG_LIBS = @XORG_LIBS@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_NMEDIT = @ac_ct_NMEDIT@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
@ -218,25 +216,34 @@ build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
distcleancheck_listfiles = @distcleancheck_listfiles@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
inputdir = @inputdir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sdkdir = @sdkdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
@ -246,13 +253,15 @@ target_alias = @target_alias@
|
||||
# -avoid-version prevents gratuitous .0.0.0 version numbers on the end
|
||||
# _ladir passes a dummy rpath to libtool so the thing will actually link
|
||||
# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
|
||||
AM_CFLAGS = $(XORG_CFLAGS)
|
||||
@DRIVER_NAME@_drv_la_LTLIBRARIES = @DRIVER_NAME@_drv.la
|
||||
@DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version $(am__append_2)
|
||||
@DRIVER_NAME@_drv_ladir = @inputdir@
|
||||
INCLUDES = -I$(top_srcdir)/include/
|
||||
@DRIVER_NAME@_drv_la_SOURCES = jstk.c jstk.h jstk_axis.c jstk_axis.h \
|
||||
jstk_key.c jstk_key.h jstk_options.c jstk_options.h \
|
||||
StrKeysym.c StrKeysym.h ks_tables.h $(am__append_1) \
|
||||
$(am__append_3) $(am__append_4)
|
||||
jstk_properties.c jstk_properties.h StrKeysym.c StrKeysym.h \
|
||||
ks_tables.h $(am__append_1) $(am__append_3) $(am__append_4)
|
||||
BSD_SRCS = backend_bsd.c backend_bsd.h
|
||||
LINUX_SRCS = backend_joystick.c backend_joystick.h
|
||||
EVDEV_SRCS = backend_evdev.c backend_evdev.h
|
||||
@ -334,6 +343,7 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jstk_axis.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jstk_key.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jstk_options.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jstk_properties.Plo@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
|
@ -43,6 +43,9 @@
|
||||
#include <usbhid.h>
|
||||
#include <dev/usb/usb.h>
|
||||
#include <dev/usb/usbhid.h>
|
||||
#ifdef HAVE_DEV_USB_USB_IOCTL_H
|
||||
#include <dev/usb/usb_ioctl.h>
|
||||
#endif
|
||||
|
||||
#include "jstk.h"
|
||||
#include "backend_bsd.h"
|
||||
@ -55,12 +58,15 @@ struct jstk_bsd_hid_data {
|
||||
struct hid_item button_item[MAXBUTTONS]; /* Button HID items */
|
||||
struct hid_item hat_item[MAXAXES]; /* HID items for hats */
|
||||
int hats; /* Number of hats */
|
||||
int axes; /* Number of found axes */
|
||||
int buttons; /* Number of found buttons */
|
||||
int hotdata; /* Is unprocessed data available
|
||||
in data_buf? */
|
||||
};
|
||||
|
||||
static void jstkCloseDevice_bsd(JoystickDevPtr joystick);
|
||||
static int jstkReadData_bsd(JoystickDevPtr joystick,
|
||||
JOYSTICKEVENT *event,
|
||||
int *number);
|
||||
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
@ -74,7 +80,7 @@ struct jstk_bsd_hid_data {
|
||||
*/
|
||||
|
||||
int
|
||||
jstkOpenDevice_bsd(JoystickDevPtr joystick)
|
||||
jstkOpenDevice_bsd(JoystickDevPtr joystick, Bool probe)
|
||||
{
|
||||
int cur_axis;
|
||||
int is_joystick, report_id = 0;
|
||||
@ -123,8 +129,8 @@ jstkOpenDevice_bsd(JoystickDevPtr joystick)
|
||||
got_something = 0;
|
||||
cur_axis = 0;
|
||||
bsddata->hats = 0;
|
||||
bsddata->axes = 0;
|
||||
bsddata->buttons = 0;
|
||||
joystick->num_axes = 0;
|
||||
joystick->num_buttons = 0;
|
||||
|
||||
for (d = hid_start_parse(rd, 1 << hid_input, report_id);
|
||||
hid_get_item(d, &h); )
|
||||
@ -147,25 +153,25 @@ jstkOpenDevice_bsd(JoystickDevPtr joystick)
|
||||
|
||||
if (page == HUP_GENERIC_DESKTOP) {
|
||||
if (usage == HUG_HAT_SWITCH) {
|
||||
if ((bsddata->hats < MAXAXES) && (bsddata->axes <= MAXAXES-2)) {
|
||||
if ((bsddata->hats < MAXAXES) && (joystick->num_axes <= MAXAXES-2)) {
|
||||
got_something = 1;
|
||||
memcpy(&bsddata->hat_item[bsddata->hats], &h, sizeof(h));
|
||||
bsddata->hats++;
|
||||
bsddata->axes += 2;
|
||||
joystick->num_axes += 2;
|
||||
}
|
||||
} else {
|
||||
if (bsddata->axes < MAXAXES) {
|
||||
if (joystick->num_axes < MAXAXES) {
|
||||
got_something = 1;
|
||||
memcpy(&bsddata->axis_item[cur_axis], &h, sizeof(h));
|
||||
cur_axis++;
|
||||
bsddata->axes++;
|
||||
joystick->num_axes++;
|
||||
}
|
||||
}
|
||||
} else if (page == HUP_BUTTON) {
|
||||
if (bsddata->buttons < MAXBUTTONS) {
|
||||
if (joystick->num_buttons < MAXBUTTONS) {
|
||||
got_something = 1;
|
||||
memcpy(&bsddata->button_item[bsddata->buttons], &h, sizeof(h));
|
||||
bsddata->buttons++;
|
||||
memcpy(&bsddata->button_item[joystick->num_buttons], &h, sizeof(h));
|
||||
joystick->num_buttons++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -182,9 +188,12 @@ jstkOpenDevice_bsd(JoystickDevPtr joystick)
|
||||
|
||||
bsddata->hotdata = 0;
|
||||
joystick->devicedata = (void*) bsddata;
|
||||
xf86Msg(X_INFO, "Joystick: %d buttons, %d axes\n",
|
||||
bsddata->buttons, bsddata->axes);
|
||||
if (probe == TRUE) {
|
||||
xf86Msg(X_INFO, "Joystick: %d buttons, %d axes\n",
|
||||
joystick->num_buttons, joystick->num_axes);
|
||||
}
|
||||
|
||||
joystick->open_proc = jstkOpenDevice_bsd;
|
||||
joystick->read_proc = jstkReadData_bsd;
|
||||
joystick->close_proc = jstkCloseDevice_bsd;
|
||||
|
||||
@ -201,7 +210,7 @@ jstkOpenDevice_bsd(JoystickDevPtr joystick)
|
||||
***********************************************************************
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
jstkCloseDevice_bsd(JoystickDevPtr joystick)
|
||||
{
|
||||
if ((joystick->fd >= 0)) {
|
||||
@ -228,7 +237,7 @@ jstkCloseDevice_bsd(JoystickDevPtr joystick)
|
||||
***********************************************************************
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
jstkReadData_bsd(JoystickDevPtr joystick,
|
||||
JOYSTICKEVENT *event,
|
||||
int *number)
|
||||
@ -249,7 +258,7 @@ jstkReadData_bsd(JoystickDevPtr joystick,
|
||||
bsddata->hotdata = 1;
|
||||
}
|
||||
|
||||
for (j=0; j<bsddata->axes - (bsddata->hats * 2); j++) {
|
||||
for (j=0; j<joystick->num_axes - (bsddata->hats * 2); j++) {
|
||||
d = hid_get_data(bsddata->data_buf, &bsddata->axis_item[j]);
|
||||
/* Scale the range to our expected range of -32768 to 32767 */
|
||||
d = d - (bsddata->axis_item[j].logical_maximum
|
||||
@ -258,7 +267,6 @@ jstkReadData_bsd(JoystickDevPtr joystick,
|
||||
- bsddata->axis_item[j].logical_minimum);
|
||||
if (abs(d) < joystick->axis[j].deadzone) d = 0;
|
||||
if (d != joystick->axis[j].value) {
|
||||
joystick->axis[j].oldvalue = joystick->axis[j].value;
|
||||
joystick->axis[j].value = d;
|
||||
if (event != NULL) *event = EVENT_AXIS;
|
||||
if (number != NULL) *number = j;
|
||||
@ -273,18 +281,16 @@ jstkReadData_bsd(JoystickDevPtr joystick,
|
||||
int v2_data[9] =
|
||||
{ -32768, -32768, 0, 32767, 32767, 32767, 0, -32767, 0 };
|
||||
|
||||
a = j*2 + bsddata->axes - bsddata->hats *2;
|
||||
a = j*2 + joystick->num_axes - bsddata->hats *2;
|
||||
d = hid_get_data(bsddata->data_buf, &bsddata->hat_item[j])
|
||||
- bsddata->hat_item[j].logical_minimum;
|
||||
if (joystick->axis[a].value != v1_data[d]) {
|
||||
joystick->axis[a].oldvalue = joystick->axis[a].value;
|
||||
joystick->axis[a].value = v1_data[d];
|
||||
if (event != NULL) *event = EVENT_AXIS;
|
||||
if (number != NULL) *number = a;
|
||||
return 2;
|
||||
}
|
||||
if (joystick->axis[a+1].value != v2_data[d]) {
|
||||
joystick->axis[a+1].oldvalue = joystick->axis[a+1].value;
|
||||
joystick->axis[a+1].value = v2_data[d];
|
||||
if (event != NULL) *event = EVENT_AXIS;
|
||||
if (number != NULL) *number = a+1;
|
||||
@ -292,7 +298,7 @@ jstkReadData_bsd(JoystickDevPtr joystick,
|
||||
}
|
||||
}
|
||||
|
||||
for (j=0; j<bsddata->buttons; j++) {
|
||||
for (j=0; j<joystick->num_buttons; j++) {
|
||||
int pressed;
|
||||
d = hid_get_data(bsddata->data_buf, &bsddata->button_item[j]);
|
||||
pressed = (d == bsddata->button_item[j].logical_minimum) ? 0 : 1;
|
||||
|
@ -26,10 +26,6 @@
|
||||
|
||||
#include "jstk.h"
|
||||
|
||||
int jstkOpenDevice_bsd(JoystickDevPtr joystick);
|
||||
void jstkCloseDevice_bsd(JoystickDevPtr joystick);
|
||||
int jstkReadData_bsd(JoystickDevPtr joystick,
|
||||
JOYSTICKEVENT *event,
|
||||
int *number);
|
||||
int jstkOpenDevice_bsd(JoystickDevPtr joystick, Bool probe);
|
||||
|
||||
#endif
|
||||
|
@ -61,6 +61,11 @@ struct jstk_evdev_data {
|
||||
};
|
||||
|
||||
|
||||
static void jstkCloseDevice_evdev(JoystickDevPtr joystick);
|
||||
static int jstkReadData_evdev(JoystickDevPtr joystick,
|
||||
JOYSTICKEVENT *event,
|
||||
int *number);
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* jstkOpenDevice --
|
||||
@ -73,7 +78,7 @@ struct jstk_evdev_data {
|
||||
*/
|
||||
|
||||
int
|
||||
jstkOpenDevice_evdev(JoystickDevPtr joystick)
|
||||
jstkOpenDevice_evdev(JoystickDevPtr joystick, Bool probe)
|
||||
{
|
||||
int driver_version;
|
||||
char name[256];
|
||||
@ -176,13 +181,23 @@ jstkOpenDevice_evdev(JoystickDevPtr joystick)
|
||||
if (ioctl(joystick->fd, EVIOCGUNIQ(sizeof(uniq)), uniq) == -1)
|
||||
strcpy(uniq, "No name");
|
||||
|
||||
xf86Msg(X_INFO, "Joystick: %s. bus 0x%x vendor 0x%x product 0x%x version 0x%x\n",
|
||||
name, id.bustype, id.vendor, id.product, id.version);
|
||||
xf86Msg(X_INFO, "Joystick: found %d axes, %d buttons\n", axes, buttons);
|
||||
if (probe == TRUE) {
|
||||
xf86Msg(X_INFO, "Joystick: %s. bus 0x%x vendor 0x%x product 0x%x version 0x%x\n",
|
||||
name, id.bustype, id.vendor, id.product, id.version);
|
||||
xf86Msg(X_INFO, "Joystick: found %d axes, %d buttons\n", axes, buttons);
|
||||
}
|
||||
|
||||
joystick->open_proc = jstkOpenDevice_evdev;
|
||||
joystick->read_proc = jstkReadData_evdev;
|
||||
joystick->close_proc = jstkCloseDevice_evdev;
|
||||
joystick->devicedata = (void*) evdevdata;
|
||||
|
||||
if (buttons > MAXBUTTONS)
|
||||
buttons = MAXBUTTONS;
|
||||
if (axes > MAXAXES)
|
||||
axes = MAXAXES;
|
||||
joystick->num_buttons = buttons;
|
||||
joystick->num_axes = axes;
|
||||
return joystick->fd;
|
||||
}
|
||||
|
||||
@ -196,7 +211,7 @@ jstkOpenDevice_evdev(JoystickDevPtr joystick)
|
||||
***********************************************************************
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
jstkCloseDevice_evdev(JoystickDevPtr joystick)
|
||||
{
|
||||
if ((joystick->fd >= 0)) {
|
||||
@ -222,7 +237,7 @@ jstkCloseDevice_evdev(JoystickDevPtr joystick)
|
||||
***********************************************************************
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
jstkReadData_evdev(JoystickDevPtr joystick,
|
||||
JOYSTICKEVENT *event,
|
||||
int *number)
|
||||
@ -266,15 +281,11 @@ jstkReadData_evdev(JoystickDevPtr joystick,
|
||||
if (abs(value) < joystick->axis[axis->number].deadzone) {
|
||||
/* We only want one event when in deadzone */
|
||||
if (joystick->axis[axis->number].value != 0) {
|
||||
joystick->axis[axis->number].oldvalue =
|
||||
joystick->axis[axis->number].value;
|
||||
joystick->axis[axis->number].value = 0;
|
||||
if (event != NULL) *event = EVENT_AXIS;
|
||||
if (number != NULL) *number = axis->number;
|
||||
}
|
||||
}else{
|
||||
joystick->axis[axis->number].oldvalue =
|
||||
joystick->axis[axis->number].value;
|
||||
joystick->axis[axis->number].value = value;
|
||||
if (event != NULL) *event = EVENT_AXIS;
|
||||
if (number != NULL) *number = axis->number;
|
||||
|
@ -26,10 +26,6 @@
|
||||
|
||||
#include "jstk.h"
|
||||
|
||||
int jstkOpenDevice_evdev(JoystickDevPtr joystick);
|
||||
void jstkCloseDevice_evdev(JoystickDevPtr joystick);
|
||||
int jstkReadData_evdev(JoystickDevPtr joystick,
|
||||
JOYSTICKEVENT *event,
|
||||
int *number);
|
||||
int jstkOpenDevice_evdev(JoystickDevPtr joystick, Bool probe);
|
||||
|
||||
#endif
|
||||
|
@ -48,6 +48,12 @@
|
||||
#include "backend_joystick.h"
|
||||
|
||||
|
||||
static void jstkCloseDevice_joystick(JoystickDevPtr joystick);
|
||||
static int jstkReadData_joystick(JoystickDevPtr joystick,
|
||||
JOYSTICKEVENT *event,
|
||||
int *number);
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* jstkOpenDevice --
|
||||
@ -60,7 +66,7 @@
|
||||
*/
|
||||
|
||||
int
|
||||
jstkOpenDevice_joystick(JoystickDevPtr joystick)
|
||||
jstkOpenDevice_joystick(JoystickDevPtr joystick, Bool probe)
|
||||
{
|
||||
char joy_name[128];
|
||||
unsigned char axes, buttons;
|
||||
@ -110,9 +116,19 @@ jstkOpenDevice_joystick(JoystickDevPtr joystick)
|
||||
return -1;
|
||||
}
|
||||
|
||||
xf86Msg(X_INFO, "Joystick: %s. %d axes, %d buttons\n",
|
||||
joy_name, axes, buttons);
|
||||
if (probe == TRUE) {
|
||||
xf86Msg(X_INFO, "Joystick: %s. %d axes, %d buttons\n",
|
||||
joy_name, axes, buttons);
|
||||
}
|
||||
|
||||
if (buttons > MAXBUTTONS)
|
||||
buttons = MAXBUTTONS;
|
||||
if (axes > MAXAXES)
|
||||
axes = MAXAXES;
|
||||
joystick->num_buttons = buttons;
|
||||
joystick->num_axes = axes;
|
||||
|
||||
joystick->open_proc = jstkOpenDevice_joystick;
|
||||
joystick->read_proc = jstkReadData_joystick;
|
||||
joystick->close_proc = jstkCloseDevice_joystick;
|
||||
return joystick->fd;
|
||||
@ -128,7 +144,7 @@ jstkOpenDevice_joystick(JoystickDevPtr joystick)
|
||||
***********************************************************************
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
jstkCloseDevice_joystick(JoystickDevPtr joystick)
|
||||
{
|
||||
if ((joystick->fd >= 0)) {
|
||||
@ -150,7 +166,7 @@ jstkCloseDevice_joystick(JoystickDevPtr joystick)
|
||||
***********************************************************************
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
jstkReadData_joystick(JoystickDevPtr joystick,
|
||||
JOYSTICKEVENT *event,
|
||||
int *number)
|
||||
@ -177,15 +193,11 @@ jstkReadData_joystick(JoystickDevPtr joystick,
|
||||
if (abs(js.value) < joystick->axis[js.number].deadzone) {
|
||||
/* We only want one event when in deadzone */
|
||||
if (joystick->axis[js.number].value != 0) {
|
||||
joystick->axis[js.number].oldvalue =
|
||||
joystick->axis[js.number].value;
|
||||
joystick->axis[js.number].value = 0;
|
||||
if (event != NULL) *event = EVENT_AXIS;
|
||||
if (number != NULL) *number = js.number;
|
||||
}
|
||||
}else{
|
||||
joystick->axis[js.number].oldvalue =
|
||||
joystick->axis[js.number].value;
|
||||
joystick->axis[js.number].value = js.value;
|
||||
if (event != NULL) *event = EVENT_AXIS;
|
||||
if (number != NULL) *number = js.number;
|
||||
|
@ -26,10 +26,6 @@
|
||||
|
||||
#include "jstk.h"
|
||||
|
||||
int jstkOpenDevice_joystick(JoystickDevPtr joystick);
|
||||
void jstkCloseDevice_joystick(JoystickDevPtr joystick);
|
||||
int jstkReadData_joystick(JoystickDevPtr joystick,
|
||||
JOYSTICKEVENT *event,
|
||||
int *number);
|
||||
int jstkOpenDevice_joystick(JoystickDevPtr joystick, Bool probe);
|
||||
|
||||
#endif
|
||||
|
@ -27,12 +27,13 @@
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <xf86Version.h>
|
||||
#include <xorgVersion.h>
|
||||
|
||||
#include <misc.h>
|
||||
#include <xf86.h>
|
||||
#include <xf86Xinput.h>
|
||||
#include <exevents.h> /* Needed for InitValuator/Proximity stuff */
|
||||
#include <xf86Opt.h>
|
||||
|
||||
#include <math.h>
|
||||
#include <xf86Module.h>
|
||||
@ -42,6 +43,7 @@
|
||||
#include "jstk_axis.h"
|
||||
#include "jstk_key.h"
|
||||
#include "jstk_options.h"
|
||||
#include "jstk_properties.h"
|
||||
|
||||
#ifdef LINUX_BACKEND
|
||||
#include "backend_joystick.h"
|
||||
@ -55,7 +57,7 @@
|
||||
|
||||
|
||||
#if DEBUG
|
||||
int debug_level = 0;
|
||||
char debug_level = 0;
|
||||
#endif
|
||||
|
||||
|
||||
@ -105,22 +107,25 @@ jstkConvertProc(LocalDevicePtr local,
|
||||
***************************************************************************
|
||||
*/
|
||||
static int
|
||||
jstkOpenDevice(JoystickDevPtr priv)
|
||||
jstkOpenDevice(JoystickDevPtr priv, BOOL probe)
|
||||
{
|
||||
int fd;
|
||||
fd = -1;
|
||||
|
||||
if (probe == FALSE && priv->open_proc)
|
||||
return priv->open_proc(priv, probe);
|
||||
|
||||
#ifdef EVDEV_BACKEND
|
||||
if (fd == -1)
|
||||
fd = jstkOpenDevice_evdev(priv);
|
||||
fd = jstkOpenDevice_evdev(priv, probe);
|
||||
#endif
|
||||
#ifdef LINUX_BACKEND
|
||||
if (fd == -1)
|
||||
fd = jstkOpenDevice_joystick(priv);
|
||||
fd = jstkOpenDevice_joystick(priv, probe);
|
||||
#endif
|
||||
#ifdef BSD_BACKEND
|
||||
if (fd == -1)
|
||||
fd = jstkOpenDevice_bsd(priv);
|
||||
fd = jstkOpenDevice_bsd(priv, probe);
|
||||
#endif
|
||||
|
||||
return fd;
|
||||
@ -164,43 +169,43 @@ jstkReadProc(LocalDevicePtr local)
|
||||
priv->button[number].mapping));
|
||||
|
||||
switch (priv->button[number].mapping) {
|
||||
case MAPPING_BUTTON:
|
||||
case JSTK_MAPPING_BUTTON:
|
||||
if (priv->mouse_enabled == TRUE) {
|
||||
xf86PostButtonEvent(local->dev, 0,
|
||||
xf86PostButtonEvent(local->dev, 0,
|
||||
priv->button[number].buttonnumber,
|
||||
priv->button[number].pressed, 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case MAPPING_X:
|
||||
case MAPPING_Y:
|
||||
case MAPPING_ZX:
|
||||
case MAPPING_ZY:
|
||||
case JSTK_MAPPING_X:
|
||||
case JSTK_MAPPING_Y:
|
||||
case JSTK_MAPPING_ZX:
|
||||
case JSTK_MAPPING_ZY:
|
||||
if (priv->button[number].pressed == 0)
|
||||
priv->button[number].currentspeed = 1.0;
|
||||
else if (priv->mouse_enabled == TRUE)
|
||||
jstkStartButtonAxisTimer(local, number);
|
||||
break;
|
||||
|
||||
case MAPPING_KEY:
|
||||
case JSTK_MAPPING_KEY:
|
||||
if (priv->keys_enabled == TRUE)
|
||||
jstkGenerateKeys(local->dev,
|
||||
jstkGenerateKeys(priv->keyboard_device,
|
||||
priv->button[number].keys,
|
||||
priv->button[number].pressed);
|
||||
break;
|
||||
|
||||
case MAPPING_SPEED_MULTIPLY:
|
||||
case JSTK_MAPPING_SPEED_MULTIPLY:
|
||||
priv->amplify = 1.0;
|
||||
/* Calculate new amplify value by multiplying them all */
|
||||
for (i=0; i<MAXAXES; i++) {
|
||||
if ((priv->button[i].pressed) &&
|
||||
(priv->button[i].mapping == MAPPING_SPEED_MULTIPLY))
|
||||
(priv->button[i].mapping == JSTK_MAPPING_SPEED_MULTIPLY))
|
||||
priv->amplify *= priv->button[i].amplify;
|
||||
}
|
||||
DBG(2, ErrorF("Amplify is now %.3f\n", priv->amplify));
|
||||
break;
|
||||
|
||||
case MAPPING_DISABLE:
|
||||
case JSTK_MAPPING_DISABLE:
|
||||
if (priv->button[number].pressed == 1) {
|
||||
if ((priv->mouse_enabled == TRUE) ||
|
||||
(priv->keys_enabled == TRUE))
|
||||
@ -215,7 +220,7 @@ jstkReadProc(LocalDevicePtr local)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MAPPING_DISABLE_MOUSE:
|
||||
case JSTK_MAPPING_DISABLE_MOUSE:
|
||||
if (priv->button[number].pressed == 1) {
|
||||
if (priv->mouse_enabled == TRUE)
|
||||
priv->mouse_enabled = FALSE;
|
||||
@ -224,7 +229,7 @@ jstkReadProc(LocalDevicePtr local)
|
||||
priv->mouse_enabled ? "enabled" : "disabled"));
|
||||
}
|
||||
break;
|
||||
case MAPPING_DISABLE_KEYS:
|
||||
case JSTK_MAPPING_DISABLE_KEYS:
|
||||
if (priv->button[number].pressed == 1) {
|
||||
if (priv->keys_enabled == TRUE)
|
||||
priv->keys_enabled = FALSE;
|
||||
@ -241,7 +246,7 @@ jstkReadProc(LocalDevicePtr local)
|
||||
|
||||
/* An axis was moved */
|
||||
if ((event == EVENT_AXIS) &&
|
||||
(priv->axis[number].type != TYPE_NONE))
|
||||
(priv->axis[number].type != JSTK_TYPE_NONE))
|
||||
{
|
||||
DBG(5, ErrorF("Axis %d moved to %d. Type: %d, Mapping: %d\n",
|
||||
number,
|
||||
@ -254,49 +259,38 @@ jstkReadProc(LocalDevicePtr local)
|
||||
1, priv->axis[number].value);
|
||||
|
||||
switch (priv->axis[number].mapping) {
|
||||
case MAPPING_X:
|
||||
case MAPPING_Y:
|
||||
case MAPPING_ZX:
|
||||
case MAPPING_ZY:
|
||||
case JSTK_MAPPING_X:
|
||||
case JSTK_MAPPING_Y:
|
||||
case JSTK_MAPPING_ZX:
|
||||
case JSTK_MAPPING_ZY:
|
||||
switch (priv->axis[number].type) {
|
||||
case TYPE_BYVALUE:
|
||||
case TYPE_ACCELERATED:
|
||||
case JSTK_TYPE_BYVALUE:
|
||||
case JSTK_TYPE_ACCELERATED:
|
||||
if (priv->axis[number].value == 0)
|
||||
priv->axis[number].currentspeed = 1.0;
|
||||
if (priv->mouse_enabled == TRUE)
|
||||
jstkStartAxisTimer(local, number);
|
||||
break;
|
||||
|
||||
case TYPE_ABSOLUTE:
|
||||
case JSTK_TYPE_ABSOLUTE:
|
||||
if (priv->mouse_enabled == TRUE)
|
||||
jstkHandleAbsoluteAxis(local, number);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
} /* switch (priv->axis[number].type) */
|
||||
break; /* case MAPPING_ZY */
|
||||
break; /* case JSTK_MAPPING_ZY */
|
||||
|
||||
case MAPPING_KEY: if (priv->keys_enabled == TRUE) {
|
||||
if (priv->axis[number].type == TYPE_ACCELERATED) {
|
||||
if ((priv->axis[number].value > 0) !=
|
||||
(priv->axis[number].oldvalue > 0))
|
||||
jstkGenerateKeys(local->dev,
|
||||
priv->axis[number].keys_high,
|
||||
(priv->axis[number].value > 0) ? 1:0);
|
||||
|
||||
if ((priv->axis[number].value < 0) !=
|
||||
(priv->axis[number].oldvalue < 0))
|
||||
jstkGenerateKeys(local->dev,
|
||||
priv->axis[number].keys_low,
|
||||
(priv->axis[number].value < 0) ? 1:0);
|
||||
} else if (priv->axis[number].type == TYPE_BYVALUE) {
|
||||
if (priv->keys_enabled == TRUE)
|
||||
jstkStartAxisTimer(local, number);
|
||||
case JSTK_MAPPING_KEY: if (priv->keys_enabled == TRUE) {
|
||||
if (priv->axis[number].type == JSTK_TYPE_ACCELERATED) {
|
||||
jstkHandlePWMAxis(local, number);
|
||||
} else if (priv->axis[number].type == JSTK_TYPE_BYVALUE) {
|
||||
jstkStartAxisTimer(local, number);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case MAPPING_NONE:
|
||||
case JSTK_MAPPING_NONE:
|
||||
default:
|
||||
break;
|
||||
} /* switch (priv->axis[number].mapping) */
|
||||
@ -306,6 +300,15 @@ jstkReadProc(LocalDevicePtr local)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static void
|
||||
jstkPtrCtrlProc(DeviceIntPtr device, PtrCtrl *ctrl)
|
||||
{
|
||||
/* Nothing to do, dix handles all settings */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
***************************************************************************
|
||||
*
|
||||
@ -327,29 +330,40 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
|
||||
switch (what) {
|
||||
case DEVICE_INIT: {
|
||||
int m;
|
||||
CARD8 buttonmap[BUTTONMAP_SIZE+1];
|
||||
DBG(1, ErrorF("jstkDeviceControlProc what=INIT\n"));
|
||||
/* We want the first 7 button numbers fixed */
|
||||
if (priv->buttonmap.size != 0) {
|
||||
if (InitButtonClassDeviceStruct(pJstk, priv->buttonmap.size,
|
||||
priv->buttonmap.map) == FALSE) {
|
||||
ErrorF("unable to allocate Button class device\n");
|
||||
return !Success;
|
||||
}
|
||||
if (InitFocusClassDeviceStruct(pJstk) == FALSE) {
|
||||
ErrorF("unable to init Focus class device\n");
|
||||
return !Success;
|
||||
}
|
||||
/* Probe device and return if error */
|
||||
if (jstkOpenDevice(priv, TRUE) == -1) {
|
||||
return !Success;
|
||||
} else {
|
||||
/* Success. The OpenDevice call already did some initialization
|
||||
like priv->num_buttons, priv->num_axes */
|
||||
priv->close_proc(priv);
|
||||
}
|
||||
jstkInitKeys(pJstk, priv);
|
||||
|
||||
for (m=0; m<=BUTTONMAP_SIZE; m++)
|
||||
buttonmap[m] = m;
|
||||
if (InitButtonClassDeviceStruct(pJstk, BUTTONMAP_SIZE,
|
||||
buttonmap) == FALSE) {
|
||||
ErrorF("unable to allocate Button class device\n");
|
||||
return !Success;
|
||||
}
|
||||
if (!InitPtrFeedbackClassDeviceStruct(pJstk, jstkPtrCtrlProc))
|
||||
return !Success;
|
||||
|
||||
m = 2;
|
||||
for (i=0; i<MAXAXES; i++)
|
||||
if (priv->axis[i].type != TYPE_NONE)
|
||||
priv->axis[i].valuator = m++;
|
||||
if (priv->axis[i].valuator != -1)
|
||||
{
|
||||
DBG(3, ErrorF("Axis %d will be valuator %d\n", i, m));
|
||||
priv->axis[i].valuator = m++;
|
||||
}
|
||||
|
||||
if (InitValuatorClassDeviceStruct(pJstk,
|
||||
m,
|
||||
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
|
||||
xf86GetMotionEvents,
|
||||
#endif
|
||||
local->history_size,
|
||||
Relative) == FALSE) {
|
||||
ErrorF("unable to allocate Valuator class device\n");
|
||||
@ -370,7 +384,7 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
|
||||
0, /* min_res */
|
||||
1); /* max_res */
|
||||
for (i=0; i<MAXAXES; i++)
|
||||
if (priv->axis[i].type != TYPE_NONE)
|
||||
if (priv->axis[i].valuator != -1)
|
||||
{
|
||||
InitValuatorAxisStruct(pJstk,
|
||||
priv->axis[i].valuator,
|
||||
@ -383,6 +397,22 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
|
||||
/* allocate the motion history buffer if needed */
|
||||
xf86MotionHistoryAllocate(local);
|
||||
}
|
||||
|
||||
|
||||
if (priv->keyboard_device != NULL)
|
||||
{
|
||||
DBG(2, ErrorF("Activating keyboard device\n"));
|
||||
xf86ActivateDevice(priv->keyboard_device);
|
||||
priv->keyboard_device->dev->inited =
|
||||
(priv->keyboard_device->device_control(priv->keyboard_device->dev, DEVICE_INIT) == Success);
|
||||
xf86EnableDevice(priv->keyboard_device->dev);
|
||||
DBG(2, ErrorF("Keyboard device activated\n"));
|
||||
}
|
||||
|
||||
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
|
||||
jstkInitProperties(pJstk, priv);
|
||||
#endif
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -390,7 +420,7 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
|
||||
DBG(1, ErrorF("jstkDeviceControlProc what=ON name=%s\n",
|
||||
priv->device));
|
||||
|
||||
if (jstkOpenDevice(priv) != -1) {
|
||||
if (jstkOpenDevice(priv, FALSE) != -1) {
|
||||
pJstk->public.on = TRUE;
|
||||
local->fd = priv->fd;
|
||||
AddEnabledDevice(local->fd);
|
||||
@ -408,6 +438,12 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
|
||||
priv->timerrunning = FALSE;
|
||||
TimerCancel(priv->timer);
|
||||
}
|
||||
for (i = 0; i < MAXAXES; i++)
|
||||
if (priv->axis[i].timerrunning)
|
||||
{
|
||||
priv->axis[i].timerrunning = FALSE;
|
||||
TimerCancel(priv->axis[i].timer);
|
||||
}
|
||||
|
||||
if (local->fd >= 0)
|
||||
RemoveEnabledDevice(local->fd);
|
||||
@ -427,6 +463,17 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
|
||||
|
||||
|
||||
|
||||
|
||||
_X_EXPORT InputDriverRec JSTK_KEYBOARD = {
|
||||
1,
|
||||
"joystick_keyboard",
|
||||
NULL,
|
||||
jstkKeyboardPreInit,
|
||||
jstkKeyboardUnInit,
|
||||
NULL,
|
||||
0
|
||||
};
|
||||
|
||||
/*
|
||||
***************************************************************************
|
||||
*
|
||||
@ -455,7 +502,6 @@ jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
|
||||
|
||||
local->name = dev->identifier;
|
||||
local->flags = XI86_POINTER_CAPABLE;
|
||||
local->flags |= XI86_KEYBOARD_CAPABLE;
|
||||
local->flags |= XI86_SEND_DRAG_EVENTS;
|
||||
local->device_control = jstkDeviceControlProc;
|
||||
local->read_input = jstkReadProc;
|
||||
@ -466,12 +512,15 @@ jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
|
||||
local->fd = -1;
|
||||
local->dev = NULL;
|
||||
local->private = priv;
|
||||
local->type_name = XI_MOUSE;
|
||||
local->type_name = XI_JOYSTICK;
|
||||
local->history_size = 0;
|
||||
local->always_core_feedback = 0;
|
||||
local->always_core_feedback = NULL;
|
||||
local->conf_idev = dev;
|
||||
|
||||
priv->fd = -1;
|
||||
priv->open_proc = NULL;
|
||||
priv->read_proc = NULL;
|
||||
priv->close_proc = NULL;
|
||||
priv->device = NULL;
|
||||
priv->devicedata = NULL;
|
||||
priv->timer = NULL;
|
||||
@ -479,69 +528,67 @@ jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
|
||||
priv->mouse_enabled = TRUE;
|
||||
priv->keys_enabled = TRUE;
|
||||
priv->amplify = 1.0f;
|
||||
priv->buttonmap.size = 0;
|
||||
priv->keyboard_device = NULL;
|
||||
priv->keymap.size = 1;
|
||||
memset(priv->keymap.map, NoSymbol, sizeof(priv->keymap.map));
|
||||
priv->repeat_delay = 0;
|
||||
priv->repeat_interval = 0;
|
||||
priv->num_axes = MAXAXES;
|
||||
priv->num_buttons = MAXBUTTONS;
|
||||
|
||||
/* Initialize default mappings */
|
||||
for (i=0; i<MAXAXES; i++) {
|
||||
priv->axis[i].value = 0;
|
||||
priv->axis[i].oldvalue = 0;
|
||||
priv->axis[i].deadzone = 5000;
|
||||
priv->axis[i].type = TYPE_NONE;
|
||||
priv->axis[i].mapping = MAPPING_NONE;
|
||||
priv->axis[i].type = JSTK_TYPE_NONE;
|
||||
priv->axis[i].mapping = JSTK_MAPPING_NONE;
|
||||
priv->axis[i].currentspeed = 0.0f;
|
||||
priv->axis[i].amplify = 1.0f;
|
||||
priv->axis[i].valuator = -1;
|
||||
priv->axis[i].subpixel = 0.0f;
|
||||
priv->axis[i].timer = NULL;
|
||||
priv->axis[i].timerrunning = FALSE;
|
||||
priv->axis[i].key_isdown = 0;
|
||||
for (j=0; j<MAXKEYSPERBUTTON; j++)
|
||||
priv->axis[i].keys_low[j] = priv->axis[i].keys_high[j] = 0;
|
||||
}
|
||||
for (i=0; i<MAXBUTTONS; i++) {
|
||||
priv->button[i].pressed = 0;
|
||||
priv->button[i].buttonnumber = 0;
|
||||
priv->button[i].mapping = MAPPING_NONE;
|
||||
priv->button[i].mapping = JSTK_MAPPING_NONE;
|
||||
priv->button[i].currentspeed = 1.0f;
|
||||
priv->button[i].subpixel = 0.0f;
|
||||
priv->button[i].amplify = 1.0;
|
||||
for (j=0; j<MAXKEYSPERBUTTON; j++)
|
||||
priv->button[i].keys[j] = 0;
|
||||
}
|
||||
|
||||
priv->buttonmap.map[0] = 0;
|
||||
|
||||
/* First three joystick buttons generate mouse clicks */
|
||||
priv->button[0].mapping = MAPPING_BUTTON;
|
||||
priv->button[0].buttonnumber = jstkGetButtonNumberInMap(priv, 1);
|
||||
priv->button[1].mapping = MAPPING_BUTTON;
|
||||
priv->button[1].buttonnumber = jstkGetButtonNumberInMap(priv, 2);
|
||||
priv->button[2].mapping = MAPPING_BUTTON;
|
||||
priv->button[2].buttonnumber = jstkGetButtonNumberInMap(priv, 3);
|
||||
priv->button[0].mapping = JSTK_MAPPING_BUTTON;
|
||||
priv->button[0].buttonnumber = 1;
|
||||
priv->button[1].mapping = JSTK_MAPPING_BUTTON;
|
||||
priv->button[1].buttonnumber = 2;
|
||||
priv->button[2].mapping = JSTK_MAPPING_BUTTON;
|
||||
priv->button[2].buttonnumber = 3;
|
||||
|
||||
/* First two axes are a stick for moving */
|
||||
priv->axis[0].type = TYPE_BYVALUE;
|
||||
priv->axis[0].mapping = MAPPING_X;
|
||||
priv->axis[1].type = TYPE_BYVALUE;
|
||||
priv->axis[1].mapping = MAPPING_Y;
|
||||
priv->axis[0].type = JSTK_TYPE_BYVALUE;
|
||||
priv->axis[0].mapping = JSTK_MAPPING_X;
|
||||
priv->axis[1].type = JSTK_TYPE_BYVALUE;
|
||||
priv->axis[1].mapping = JSTK_MAPPING_Y;
|
||||
|
||||
/* Next two axes are a stick for scrolling */
|
||||
priv->axis[2].type = TYPE_BYVALUE;
|
||||
priv->axis[2].mapping = MAPPING_ZX;
|
||||
priv->axis[3].type = TYPE_BYVALUE;
|
||||
priv->axis[3].mapping = MAPPING_ZY;
|
||||
priv->axis[2].type = JSTK_TYPE_BYVALUE;
|
||||
priv->axis[2].mapping = JSTK_MAPPING_ZX;
|
||||
priv->axis[3].type = JSTK_TYPE_BYVALUE;
|
||||
priv->axis[3].mapping = JSTK_MAPPING_ZY;
|
||||
|
||||
/* Next two axes are a pad for moving */
|
||||
priv->axis[4].type = TYPE_ACCELERATED;
|
||||
priv->axis[4].mapping = MAPPING_X;
|
||||
priv->axis[5].type = TYPE_ACCELERATED;
|
||||
priv->axis[5].mapping = MAPPING_Y;
|
||||
|
||||
priv->buttonmap.scrollbutton[0] = jstkGetButtonNumberInMap(priv, 4);
|
||||
priv->buttonmap.scrollbutton[1] = jstkGetButtonNumberInMap(priv, 5);
|
||||
priv->buttonmap.scrollbutton[2] = jstkGetButtonNumberInMap(priv, 6);
|
||||
priv->buttonmap.scrollbutton[3] = jstkGetButtonNumberInMap(priv, 7);
|
||||
|
||||
priv->axis[4].type = JSTK_TYPE_ACCELERATED;
|
||||
priv->axis[4].mapping = JSTK_MAPPING_X;
|
||||
priv->axis[5].type = JSTK_TYPE_ACCELERATED;
|
||||
priv->axis[5].mapping = JSTK_MAPPING_Y;
|
||||
|
||||
xf86CollectInputOptions(local, NULL, NULL);
|
||||
xf86OptionListReport(local->options);
|
||||
@ -621,6 +668,11 @@ jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
|
||||
/* return the LocalDevice */
|
||||
local->flags |= XI86_CONFIGURED;
|
||||
|
||||
priv->keyboard_device = jstkKeyboardPreInit(&JSTK_KEYBOARD, dev, flags);
|
||||
if (priv->keyboard_device) {
|
||||
priv->keyboard_device->private = priv;
|
||||
}
|
||||
|
||||
return (local);
|
||||
|
||||
SetupProc_fail:
|
||||
@ -651,7 +703,11 @@ jstkCoreUnInit(InputDriverPtr drv,
|
||||
{
|
||||
JoystickDevPtr device = (JoystickDevPtr) local->private;
|
||||
|
||||
jstkDeviceControlProc(local->dev, DEVICE_OFF);
|
||||
if (device->keyboard_device != NULL)
|
||||
{
|
||||
xf86DisableDevice(device->keyboard_device->dev, TRUE);
|
||||
device->keyboard_device = NULL;
|
||||
}
|
||||
|
||||
xfree (device);
|
||||
local->private = NULL;
|
||||
@ -689,6 +745,7 @@ jstkDriverPlug(pointer module,
|
||||
int *errmin)
|
||||
{
|
||||
xf86AddInputDriver(&JOYSTICK, module, 0);
|
||||
xf86AddInputDriver(&JSTK_KEYBOARD, module, 0);
|
||||
return module;
|
||||
}
|
||||
|
||||
|
@ -24,11 +24,16 @@
|
||||
#ifndef __JSTK_H_INCLUDED__
|
||||
#define __JSTK_H_INCLUDED__
|
||||
|
||||
#include <xf86Xinput.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "joystick-properties.h" /* definitions */
|
||||
|
||||
|
||||
#define MAXBUTTONS 32
|
||||
#define MAXAXES 32
|
||||
#define MAXKEYSPERBUTTON 4
|
||||
#define MIN_KEYCODE 8
|
||||
#define BUTTONMAP_SIZE 32
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
@ -39,12 +44,18 @@
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
extern int debug_level;
|
||||
extern char debug_level;
|
||||
#define DBG(lvl, f) {if ((lvl) <= debug_level) f;}
|
||||
#else
|
||||
#define DBG(lvl, f)
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef XI_JOYSTICK
|
||||
#define XI_JOYSTICK "JOYSTICK"
|
||||
#endif
|
||||
|
||||
|
||||
typedef enum _JOYSTICKEVENT {
|
||||
EVENT_NONE=0,
|
||||
EVENT_BUTTON,
|
||||
@ -53,37 +64,16 @@ typedef enum _JOYSTICKEVENT {
|
||||
|
||||
typedef struct _JoystickDevRec *JoystickDevPtr;
|
||||
|
||||
typedef int(*jstkOpenDeviceProc)(JoystickDevPtr joystick, Bool probe);
|
||||
typedef void(*jstkCloseDeviceProc)(JoystickDevPtr joystick);
|
||||
typedef int(*jstkReadDataProc)(JoystickDevPtr joystick,
|
||||
JOYSTICKEVENT *event, int *number);
|
||||
|
||||
|
||||
typedef enum _JOYSTICKTYPE{
|
||||
TYPE_NONE=0, /* Axis value is not relevant */
|
||||
TYPE_BYVALUE, /* Speed of cursor is relative to amplitude */
|
||||
TYPE_ACCELERATED, /* Speed is accelerated */
|
||||
TYPE_ABSOLUTE /* The amplitude defines the cursor position */
|
||||
} JOYSTICKTYPE;
|
||||
|
||||
typedef enum _JOYSTICKMAPPING{
|
||||
MAPPING_NONE=0, /* Nothing */
|
||||
MAPPING_X, /* X-Axis */
|
||||
MAPPING_Y, /* Y-Axis */
|
||||
MAPPING_ZX, /* Horizontal scrolling */
|
||||
MAPPING_ZY, /* Vertical scrolling */
|
||||
MAPPING_BUTTON, /* Mouse button */
|
||||
MAPPING_KEY, /* Keyboard event */
|
||||
MAPPING_SPEED_MULTIPLY, /* Will amplify all axis movement */
|
||||
MAPPING_DISABLE, /* Disable mouse and key events */
|
||||
MAPPING_DISABLE_MOUSE, /* Disable only mouse events */
|
||||
MAPPING_DISABLE_KEYS /* Disable only key events */
|
||||
} JOYSTICKMAPPING;
|
||||
|
||||
typedef unsigned int KEYSCANCODES [MAXKEYSPERBUTTON];
|
||||
|
||||
typedef struct _AXIS {
|
||||
JOYSTICKTYPE type;
|
||||
JOYSTICKMAPPING mapping;
|
||||
JSTK_TYPE type;
|
||||
JSTK_MAPPING mapping;
|
||||
int value, oldvalue;
|
||||
int valuator;
|
||||
int deadzone;
|
||||
@ -91,11 +81,15 @@ typedef struct _AXIS {
|
||||
float previousposition; /* TYPE_ABSOLUTE */
|
||||
float amplify;
|
||||
float subpixel; /* Pending subpixel movement */
|
||||
|
||||
KEYSCANCODES keys_low, keys_high; /* MAPPING_KEY */
|
||||
int key_isdown;
|
||||
OsTimerPtr timer;
|
||||
Bool timerrunning;
|
||||
} AXIS;
|
||||
|
||||
typedef struct _BUTTON {
|
||||
JOYSTICKMAPPING mapping;
|
||||
JSTK_MAPPING mapping;
|
||||
char pressed;
|
||||
int buttonnumber; /* MAPPING_BUTTON */
|
||||
float amplify; /* MAPPING_X/Y/ZX/ZY,
|
||||
@ -107,10 +101,12 @@ typedef struct _BUTTON {
|
||||
|
||||
typedef struct _JoystickDevRec {
|
||||
int fd; /* Actual file descriptor */
|
||||
jstkOpenDeviceProc open_proc; /* Call for re-open backend */
|
||||
jstkCloseDeviceProc close_proc; /* Callback for closing the backend */
|
||||
jstkReadDataProc read_proc; /* Callback for reading data from the backend */
|
||||
void *devicedata; /* Extra platform device dependend data */
|
||||
char *device; /* Name of the device */
|
||||
LocalDevicePtr keyboard_device; /* Slave device for keyboard events */
|
||||
|
||||
OsTimerPtr timer; /* Timer for axis movement */
|
||||
Bool timerrunning;
|
||||
@ -120,11 +116,8 @@ typedef struct _JoystickDevRec {
|
||||
|
||||
int repeat_delay, repeat_interval; /* Key autorepeat */
|
||||
|
||||
struct _BUTTONMAP {
|
||||
int size;
|
||||
CARD8 scrollbutton[4]; /* Logical button numbers for scrollwheel */
|
||||
CARD8 map[MAXBUTTONS+1];
|
||||
} buttonmap;
|
||||
CARD8 num_buttons, num_axes; /* Detected number of buttons/axes */
|
||||
|
||||
struct _KEYMAP {
|
||||
int size;
|
||||
KeySym map[256-MIN_KEYCODE];
|
||||
|
@ -34,6 +34,7 @@
|
||||
|
||||
#include "jstk.h"
|
||||
#include "jstk_axis.h"
|
||||
#include "jstk_key.h"
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
@ -66,7 +67,7 @@ jstkAxisTimer(OsTimerPtr timer,
|
||||
sigstate = xf86BlockSIGIO();
|
||||
|
||||
for (i=0; i<MAXAXES; i++) if ((priv->axis[i].value != 0) &&
|
||||
(priv->axis[i].type != TYPE_NONE)) {
|
||||
(priv->axis[i].type != JSTK_TYPE_NONE)) {
|
||||
float p1 = 0.0f; /* Pixels to move cursor */
|
||||
float p2 = 0.0f; /* Pixels to scroll */
|
||||
float scale;
|
||||
@ -75,7 +76,7 @@ jstkAxisTimer(OsTimerPtr timer,
|
||||
|
||||
nexttimer = NEXTTIMER;
|
||||
|
||||
if (priv->axis[i].type == TYPE_BYVALUE) {
|
||||
if (priv->axis[i].type == JSTK_TYPE_BYVALUE) {
|
||||
/* Calculate scale value, so we get a range from 0 to 32768 */
|
||||
scale = (32768.0f / (float)(32768 - axis->deadzone));
|
||||
|
||||
@ -87,7 +88,7 @@ jstkAxisTimer(OsTimerPtr timer,
|
||||
p2 = ((pow((abs((float)axis->value) - (float)axis->deadzone) *
|
||||
scale / 1000.0f, 2.5f)) + 200.0f) *
|
||||
((float)NEXTTIMER / 200000.0f);
|
||||
} else if (axis->type == TYPE_ACCELERATED) {
|
||||
} else if (axis->type == JSTK_TYPE_ACCELERATED) {
|
||||
/* Stop to accelerate at a certain speed */
|
||||
if (axis->currentspeed < 100.0f)
|
||||
axis->currentspeed = (axis->currentspeed + 3.0f) * 1.07f - 3.0f;
|
||||
@ -103,13 +104,13 @@ jstkAxisTimer(OsTimerPtr timer,
|
||||
|
||||
/* Apply movement to global amount of pixels to move */
|
||||
switch (axis->mapping) {
|
||||
case MAPPING_X:
|
||||
case MAPPING_Y:
|
||||
case JSTK_MAPPING_X:
|
||||
case JSTK_MAPPING_Y:
|
||||
axis->subpixel += p1;
|
||||
break;
|
||||
case MAPPING_ZX:
|
||||
case MAPPING_ZY:
|
||||
case MAPPING_KEY:
|
||||
case JSTK_MAPPING_ZX:
|
||||
case JSTK_MAPPING_ZY:
|
||||
case JSTK_MAPPING_KEY:
|
||||
axis->subpixel += p2;
|
||||
break;
|
||||
default:
|
||||
@ -117,32 +118,32 @@ jstkAxisTimer(OsTimerPtr timer,
|
||||
}
|
||||
if ((int)axis->subpixel != 0) {
|
||||
switch (axis->mapping) {
|
||||
case MAPPING_X:
|
||||
case JSTK_MAPPING_X:
|
||||
movex += (int)axis->subpixel;
|
||||
break;
|
||||
case MAPPING_Y:
|
||||
case JSTK_MAPPING_Y:
|
||||
movey += (int)axis->subpixel;
|
||||
break;
|
||||
case MAPPING_ZX:
|
||||
case JSTK_MAPPING_ZX:
|
||||
movezx += (int)axis->subpixel;
|
||||
break;
|
||||
case MAPPING_ZY:
|
||||
case JSTK_MAPPING_ZY:
|
||||
movezy += (int)axis->subpixel;
|
||||
break;
|
||||
|
||||
case MAPPING_KEY: if ((priv->keys_enabled == TRUE) &&
|
||||
(priv->axis[i].type == TYPE_BYVALUE)) {
|
||||
case JSTK_MAPPING_KEY: if ((priv->keys_enabled == TRUE) &&
|
||||
(priv->axis[i].type == JSTK_TYPE_BYVALUE)) {
|
||||
int num;
|
||||
num = abs((int)axis->subpixel);
|
||||
if ((int)axis->subpixel < 0) {
|
||||
for (i=0; i<num; i++) {
|
||||
jstkGenerateKeys(device, axis->keys_low, 1);
|
||||
jstkGenerateKeys(device, axis->keys_low, 0);
|
||||
jstkGenerateKeys(priv->keyboard_device, axis->keys_low, 1);
|
||||
jstkGenerateKeys(priv->keyboard_device, axis->keys_low, 0);
|
||||
}
|
||||
} else {
|
||||
for (i=0; i<num; i++) {
|
||||
jstkGenerateKeys(device, axis->keys_high, 1);
|
||||
jstkGenerateKeys(device, axis->keys_high, 0);
|
||||
jstkGenerateKeys(priv->keyboard_device, axis->keys_high, 1);
|
||||
jstkGenerateKeys(priv->keyboard_device, axis->keys_high, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -168,13 +169,13 @@ jstkAxisTimer(OsTimerPtr timer,
|
||||
|
||||
/* Apply movement to amount of pixels to move */
|
||||
switch (priv->button[i].mapping) {
|
||||
case MAPPING_X:
|
||||
case MAPPING_Y:
|
||||
case JSTK_MAPPING_X:
|
||||
case JSTK_MAPPING_Y:
|
||||
priv->button[i].subpixel += p1;
|
||||
nexttimer = NEXTTIMER;
|
||||
break;
|
||||
case MAPPING_ZX:
|
||||
case MAPPING_ZY:
|
||||
case JSTK_MAPPING_ZX:
|
||||
case JSTK_MAPPING_ZY:
|
||||
priv->button[i].subpixel += p2;
|
||||
nexttimer = NEXTTIMER;
|
||||
break;
|
||||
@ -183,16 +184,16 @@ jstkAxisTimer(OsTimerPtr timer,
|
||||
}
|
||||
if ((int)priv->button[i].subpixel != 0) {
|
||||
switch (priv->button[i].mapping) {
|
||||
case MAPPING_X:
|
||||
case JSTK_MAPPING_X:
|
||||
movex += (int)priv->button[i].subpixel;
|
||||
break;
|
||||
case MAPPING_Y:
|
||||
case JSTK_MAPPING_Y:
|
||||
movey += (int)priv->button[i].subpixel;
|
||||
break;
|
||||
case MAPPING_ZX:
|
||||
case JSTK_MAPPING_ZX:
|
||||
movezx += (int)priv->button[i].subpixel;
|
||||
break;
|
||||
case MAPPING_ZY:
|
||||
case JSTK_MAPPING_ZY:
|
||||
movezy += (int)priv->button[i].subpixel;
|
||||
break;
|
||||
default:
|
||||
@ -209,31 +210,31 @@ jstkAxisTimer(OsTimerPtr timer,
|
||||
|
||||
/* Generate scrolling events */
|
||||
while (movezy >= 1) { /* down */
|
||||
xf86PostButtonEvent(device, 0, priv->buttonmap.scrollbutton[1],
|
||||
xf86PostButtonEvent(device, 0, 5,
|
||||
1, 0, 0);
|
||||
xf86PostButtonEvent(device, 0, priv->buttonmap.scrollbutton[1],
|
||||
xf86PostButtonEvent(device, 0, 5,
|
||||
0, 0, 0);
|
||||
movezy -= 1;
|
||||
}
|
||||
while (movezy <= -1) { /* up */
|
||||
xf86PostButtonEvent(device, 0, priv->buttonmap.scrollbutton[0],
|
||||
xf86PostButtonEvent(device, 0, 4,
|
||||
1, 0, 0);
|
||||
xf86PostButtonEvent(device, 0, priv->buttonmap.scrollbutton[0],
|
||||
xf86PostButtonEvent(device, 0, 4,
|
||||
0, 0, 0);
|
||||
movezy += 1;
|
||||
}
|
||||
|
||||
while (movezx >= 1) { /* right */
|
||||
xf86PostButtonEvent(device, 0, priv->buttonmap.scrollbutton[3],
|
||||
xf86PostButtonEvent(device, 0, 7,
|
||||
1, 0, 0);
|
||||
xf86PostButtonEvent(device, 0, priv->buttonmap.scrollbutton[3],
|
||||
xf86PostButtonEvent(device, 0, 7,
|
||||
0, 0, 0);
|
||||
movezx -= 1;
|
||||
}
|
||||
while (movezx <= -1) { /* left */
|
||||
xf86PostButtonEvent(device, 0, priv->buttonmap.scrollbutton[2],
|
||||
xf86PostButtonEvent(device, 0, 6,
|
||||
1, 0, 0);
|
||||
xf86PostButtonEvent(device, 0, priv->buttonmap.scrollbutton[2],
|
||||
xf86PostButtonEvent(device, 0, 6,
|
||||
0, 0, 0);
|
||||
movezx += 1;
|
||||
}
|
||||
@ -308,10 +309,10 @@ jstkStartButtonAxisTimer(LocalDevicePtr device, int number)
|
||||
pixel = 1;
|
||||
if (priv->button[number].amplify < 0) pixel = -1;
|
||||
switch (priv->button[number].mapping) {
|
||||
case MAPPING_X:
|
||||
case MAPPING_Y:
|
||||
case MAPPING_ZX:
|
||||
case MAPPING_ZY:
|
||||
case JSTK_MAPPING_X:
|
||||
case JSTK_MAPPING_Y:
|
||||
case JSTK_MAPPING_ZX:
|
||||
case JSTK_MAPPING_ZY:
|
||||
priv->button[number].subpixel += pixel;
|
||||
break;
|
||||
default:
|
||||
@ -346,13 +347,15 @@ jstkHandleAbsoluteAxis(LocalDevicePtr device, int number)
|
||||
y=0;
|
||||
|
||||
for (i=0; i<MAXAXES; i++)
|
||||
if (priv->axis[i].type == TYPE_ABSOLUTE)
|
||||
if (priv->axis[i].type == JSTK_TYPE_ABSOLUTE)
|
||||
{
|
||||
float rel;
|
||||
int dif;
|
||||
if (priv->axis[i].value >= priv->axis[i].deadzone)
|
||||
|
||||
rel = 0.0f;
|
||||
if (priv->axis[i].value > +priv->axis[i].deadzone)
|
||||
rel = (priv->axis[i].value - priv->axis[i].deadzone);
|
||||
if (priv->axis[i].value <= -priv->axis[i].deadzone)
|
||||
if (priv->axis[i].value < -priv->axis[i].deadzone)
|
||||
rel = (priv->axis[i].value + priv->axis[i].deadzone);
|
||||
|
||||
rel = (rel) / (2.0f * (float)(32768 - priv->axis[i].deadzone));
|
||||
@ -365,11 +368,11 @@ jstkHandleAbsoluteAxis(LocalDevicePtr device, int number)
|
||||
/* Calculate difference to previous position on screen in pixels */
|
||||
dif = (int)(rel - priv->axis[i].previousposition + 0.5f);
|
||||
if ((dif >= 1)||(dif <= -1)) {
|
||||
if (priv->axis[i].mapping == MAPPING_X) {
|
||||
if (priv->axis[i].mapping == JSTK_MAPPING_X) {
|
||||
x += (dif);
|
||||
priv->axis[i].previousposition += (float)dif;
|
||||
}
|
||||
if (priv->axis[i].mapping == MAPPING_Y) {
|
||||
if (priv->axis[i].mapping == JSTK_MAPPING_Y) {
|
||||
y += (int)(dif);
|
||||
priv->axis[i].previousposition += (float)dif;
|
||||
}
|
||||
@ -381,3 +384,170 @@ jstkHandleAbsoluteAxis(LocalDevicePtr device, int number)
|
||||
xf86PostMotionEvent(device->dev, 0, 0, 2, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* jstkPWMAxisTimer --
|
||||
*
|
||||
* The timer that will generate Key events.
|
||||
* The deflection of the axis will control the PERCENT OF TIME the key is
|
||||
* down, not the amount of impulses.
|
||||
* Return 0, when timer can be stopped.
|
||||
*
|
||||
***********************************************************************
|
||||
*/
|
||||
static CARD32
|
||||
jstkPWMAxisTimer(OsTimerPtr timer,
|
||||
CARD32 atime,
|
||||
pointer arg)
|
||||
{
|
||||
DeviceIntPtr device = (DeviceIntPtr)arg;
|
||||
JoystickDevPtr priv = (JoystickDevPtr)XI_PRIVATE(device);
|
||||
|
||||
int sigstate, i;
|
||||
int nexttimer;
|
||||
|
||||
nexttimer = 0;
|
||||
|
||||
sigstate = xf86BlockSIGIO();
|
||||
|
||||
for (i=0; i<MAXAXES; i++)
|
||||
if (priv->axis[i].timer == timer) /* The timer handles only one axis! Find it. */
|
||||
{
|
||||
AXIS *axis;
|
||||
axis = &priv->axis[i];
|
||||
|
||||
DBG(8, ErrorF("PWM Axis %d value %d (old %d)\n", i, axis->value, axis->oldvalue));
|
||||
|
||||
/* Force key_high down if centered */
|
||||
if ((axis->value <= 0) &&
|
||||
(axis->oldvalue > 0) &&
|
||||
(axis->key_isdown))
|
||||
{
|
||||
DBG(7, ErrorF("PWM Axis %d jumped over. Forcing keys_high up.\n", i));
|
||||
jstkGenerateKeys(priv->keyboard_device,
|
||||
axis->keys_high,
|
||||
0);
|
||||
axis->key_isdown = 0;
|
||||
}
|
||||
|
||||
/* Force key_low down if centered */
|
||||
if ((axis->value >= 0) &&
|
||||
(axis->oldvalue < 0) &&
|
||||
(axis->key_isdown))
|
||||
{
|
||||
DBG(7, ErrorF("PWM Axis %d jumped over. Forcing keys_low up.\n", i));
|
||||
jstkGenerateKeys(priv->keyboard_device,
|
||||
axis->keys_low,
|
||||
0);
|
||||
axis->key_isdown = 0;
|
||||
}
|
||||
|
||||
if (axis->value == 0)
|
||||
nexttimer = 0;
|
||||
else {
|
||||
float time_on, time_off;
|
||||
float scale;
|
||||
KEYSCANCODES *keys;
|
||||
|
||||
if (axis->value < 0)
|
||||
keys = &axis->keys_low;
|
||||
else keys = &axis->keys_high;
|
||||
|
||||
/* Calculate next timer */
|
||||
time_on = (float)(abs(axis->value) - axis->deadzone) / 32768.0;
|
||||
time_on *= (32768.0f / (float)(32768 - axis->deadzone));
|
||||
|
||||
time_off = 1.0f - time_on;
|
||||
|
||||
time_on += 0.01f; /* Ugly but ensures we don't divide by 0 */
|
||||
time_off += 0.01f;
|
||||
|
||||
/* Scale both durations, so the smaller always is 50ms */
|
||||
scale = 50.0f * axis->amplify;
|
||||
|
||||
if (time_on < time_off)
|
||||
scale /= time_on;
|
||||
else scale /= time_off;
|
||||
|
||||
time_on *= scale;
|
||||
time_off *= scale;
|
||||
|
||||
|
||||
if (time_off > 600.0f) {
|
||||
/* Might as well just have it down forever */
|
||||
DBG(7, ErrorF("PWM Axis %d up time too long (%.0fms). Forcing up)\n", i, time_off));
|
||||
if (axis->key_isdown == 1) {
|
||||
axis->key_isdown = 0;
|
||||
jstkGenerateKeys(priv->keyboard_device,
|
||||
*keys,
|
||||
axis->key_isdown);
|
||||
}
|
||||
nexttimer = 0;
|
||||
} else if (time_on > 600.0f) {
|
||||
/* Might as well just have it up forever */
|
||||
DBG(7, ErrorF("PWM Axis %d down time too long (%.0fms). Forcing down)\n", i, time_on));
|
||||
if (axis->key_isdown == 0) {
|
||||
axis->key_isdown = 1;
|
||||
jstkGenerateKeys(priv->keyboard_device,
|
||||
*keys,
|
||||
axis->key_isdown);
|
||||
}
|
||||
nexttimer = 0;
|
||||
} else {
|
||||
/* Flip key state */
|
||||
axis->key_isdown = 1 - axis->key_isdown;
|
||||
jstkGenerateKeys(priv->keyboard_device,
|
||||
*keys,
|
||||
axis->key_isdown);
|
||||
|
||||
DBG(7, ErrorF("PWM Axis %d state=%d (%.0fms down, %.0fms up).\n", i, axis->key_isdown, time_on, time_off));
|
||||
|
||||
nexttimer = axis->key_isdown ? (int)time_on : (int)time_off;
|
||||
}
|
||||
}
|
||||
|
||||
if (nexttimer == 0) { /* No next timer, stop */
|
||||
axis->timerrunning = FALSE;
|
||||
|
||||
DBG(2, ErrorF("Stopping PWM Axis %d Timer\n", i));
|
||||
}
|
||||
axis->oldvalue = axis->value;
|
||||
break;
|
||||
}
|
||||
|
||||
xf86UnblockSIGIO (sigstate);
|
||||
return nexttimer;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* jstkStartAxisTimer --
|
||||
*
|
||||
* Starts the timer for the movement.
|
||||
* Will already prepare for moving one pixel, for "tipping" the stick
|
||||
*
|
||||
***********************************************************************
|
||||
*/
|
||||
void
|
||||
jstkHandlePWMAxis(LocalDevicePtr device, int number)
|
||||
{
|
||||
JoystickDevPtr priv = device->private;
|
||||
if (priv->axis[number].timerrunning) return;
|
||||
|
||||
priv->axis[number].timerrunning = TRUE;
|
||||
|
||||
DBG(2, ErrorF("Starting PWM Axis Timer (triggered by axis %d, value %d)\n",
|
||||
number, priv->axis[number].value));
|
||||
priv->axis[number].timer = TimerSet(
|
||||
priv->axis[number].timer,
|
||||
0, /* Relative */
|
||||
1, /* What about NOW? */
|
||||
jstkPWMAxisTimer,
|
||||
device->dev);
|
||||
}
|
||||
|
@ -27,6 +27,6 @@
|
||||
void jstkStartAxisTimer(LocalDevicePtr device, int number);
|
||||
void jstkStartButtonAxisTimer(LocalDevicePtr device, int number);
|
||||
void jstkHandleAbsoluteAxis(LocalDevicePtr device, int number);
|
||||
void jstkGenerateKeys(DeviceIntPtr device, KEYSCANCODES keys, char pressed);
|
||||
void jstkHandlePWMAxis(LocalDevicePtr device, int number);
|
||||
|
||||
#endif
|
||||
|
@ -30,28 +30,49 @@
|
||||
|
||||
#include <xf86.h>
|
||||
#include <xf86Xinput.h>
|
||||
#include <X11/extensions/XKB.h>
|
||||
#include <X11/extensions/XKBstr.h>
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <X11/keysym.h>
|
||||
#include <X11/XF86keysym.h>
|
||||
#include <xf86Optrec.h>
|
||||
|
||||
#include "jstk.h"
|
||||
#include "jstk_key.h"
|
||||
|
||||
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 5
|
||||
#include <xkbsrv.h>
|
||||
#endif
|
||||
|
||||
#define AltMask Mod1Mask
|
||||
#define NumLockMask Mod2Mask
|
||||
#define AltLangMask Mod3Mask
|
||||
#define KanaMask Mod4Mask
|
||||
#define ScrollLockMask Mod5Mask
|
||||
|
||||
int
|
||||
|
||||
|
||||
|
||||
static void
|
||||
jstkKbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
***************************************************************************
|
||||
*
|
||||
* jstkInitKeys --
|
||||
*
|
||||
* Sets up the keymap, modmap and the keyboard device structs
|
||||
*
|
||||
***************************************************************************
|
||||
*/
|
||||
static int
|
||||
jstkInitKeys(DeviceIntPtr pJstk, JoystickDevPtr priv)
|
||||
{
|
||||
KeySymsRec keySyms;
|
||||
CARD8 modMap[MAP_LENGTH];
|
||||
KeySym sym;
|
||||
int i, j;
|
||||
static XkbComponentNamesRec xkbnames;
|
||||
XkbSrvInfoPtr xkbi;
|
||||
XkbControlsPtr ctrls;
|
||||
|
||||
@ -72,18 +93,11 @@ jstkInitKeys(DeviceIntPtr pJstk, JoystickDevPtr priv)
|
||||
priv->keymap.size));
|
||||
for (i = 0; i < priv->keymap.size; i++)
|
||||
{
|
||||
DBG(6, xf86Msg(X_CONFIG, "Keymap [%d]: 0x%08X\n", MIN_KEYCODE+i,priv->keymap.map[i]));
|
||||
DBG(6, xf86Msg(X_CONFIG, "Keymap [%d]: 0x%08X\n", MIN_KEYCODE+i,(unsigned int)priv->keymap.map[i]));
|
||||
}
|
||||
|
||||
memset(modMap, 0, sizeof(modMap));
|
||||
|
||||
for (i = 0; i < priv->keymap.size; i++) {
|
||||
sym = priv->keymap.map[i];
|
||||
for (j = 0; j < sizeof(modifiers)/sizeof(modifiers[0]); j++) {
|
||||
if (modifiers[j].keysym == sym)
|
||||
modMap[i + MIN_KEYCODE] = modifiers[j].mask;
|
||||
}
|
||||
}
|
||||
|
||||
keySyms.map = priv->keymap.map;
|
||||
keySyms.mapWidth = 1;
|
||||
@ -99,12 +113,26 @@ jstkInitKeys(DeviceIntPtr pJstk, JoystickDevPtr priv)
|
||||
}
|
||||
}
|
||||
|
||||
XkbSetRulesDflts(__XKBDEFRULES__, "evdev", "us", "nodeadkeys", NULL);
|
||||
XkbInitKeyboardDeviceStruct (pJstk, &xkbnames, &keySyms, modMap,
|
||||
NULL, NULL);
|
||||
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 5
|
||||
{
|
||||
XkbRMLVOSet rmlvo;
|
||||
XkbGetRulesDflts(&rmlvo);
|
||||
/* FIXME */
|
||||
#warning KEYMAP FOR ABI_XINPUT_VERSION >= 5 BROKEN RIGHT NOW
|
||||
if (!InitKeyboardDeviceStruct(pJstk, &rmlvo, NULL, jstkKbdCtrl))
|
||||
{
|
||||
ErrorF("unable to init keyboard device\n");
|
||||
return !Success;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (InitKeyboardDeviceStruct((DevicePtr)pJstk, &keySyms, modMap, NULL, jstkKbdCtrl) == FALSE) {
|
||||
ErrorF("unable to init keyboard device\n");
|
||||
return !Success;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Set Autorepeat and Delay */
|
||||
|
||||
if ((priv->repeat_delay || priv->repeat_interval) &&
|
||||
pJstk->key &&
|
||||
pJstk->key->xkbInfo)
|
||||
@ -134,11 +162,13 @@ jstkInitKeys(DeviceIntPtr pJstk, JoystickDevPtr priv)
|
||||
***************************************************************************
|
||||
*/
|
||||
void
|
||||
jstkGenerateKeys(DeviceIntPtr device, KEYSCANCODES keys, char pressed)
|
||||
jstkGenerateKeys(LocalDevicePtr device, KEYSCANCODES keys, char pressed)
|
||||
{
|
||||
int i;
|
||||
unsigned int k;
|
||||
|
||||
if (device == NULL)
|
||||
return;
|
||||
for (i=0;i<MAXKEYSPERBUTTON;i++) {
|
||||
if (pressed != 0)
|
||||
k = keys[i];
|
||||
@ -148,9 +178,145 @@ jstkGenerateKeys(DeviceIntPtr device, KEYSCANCODES keys, char pressed)
|
||||
k = k + MIN_KEYCODE;
|
||||
DBG(2, ErrorF("Generating key %s event with keycode %d\n",
|
||||
(pressed)?"press":"release", k));
|
||||
xf86PostKeyboardEvent(device, k, pressed);
|
||||
xf86PostKeyboardEvent(device->dev, k, pressed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
***************************************************************************
|
||||
*
|
||||
* jstkKeyboardDeviceControlProc --
|
||||
*
|
||||
* Handles the initialization, etc. of the keyboard device
|
||||
*
|
||||
***************************************************************************
|
||||
*/
|
||||
static Bool
|
||||
jstkKeyboardDeviceControlProc(DeviceIntPtr dev,
|
||||
int what)
|
||||
{
|
||||
JoystickDevPtr priv = (JoystickDevPtr)XI_PRIVATE(dev);
|
||||
if (!priv) {
|
||||
DBG(2, ErrorF("jstkKeyboardDeviceControlProc: priv == NULL\n"));
|
||||
return !Success;
|
||||
}
|
||||
switch (what) {
|
||||
case DEVICE_INIT:
|
||||
DBG(2, ErrorF("jstkKeyboardDeviceControlProc what=DEVICE_INIT\n"));
|
||||
if (InitFocusClassDeviceStruct(dev) == FALSE) {
|
||||
ErrorF("unable to init Focus class device\n");
|
||||
return !Success;
|
||||
}
|
||||
if (jstkInitKeys(dev, priv) != Success)
|
||||
return !Success;
|
||||
break;
|
||||
case DEVICE_ON:
|
||||
DBG(2, ErrorF("jstkKeyboardDeviceControlProc what=DEVICE_ON\n"));
|
||||
dev->public.on = TRUE;
|
||||
break;
|
||||
case DEVICE_OFF:
|
||||
DBG(2, ErrorF("jstkKeyboardDeviceControlProc what=DEVICE_OFF\n"));
|
||||
dev->public.on = FALSE;
|
||||
break;
|
||||
case DEVICE_CLOSE:
|
||||
DBG(2, ErrorF("jstkKeyboardDeviceControlProc what=DEVICE_CLOSE\n"));
|
||||
dev->public.on = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
***************************************************************************
|
||||
*
|
||||
* jstkKeyboardPreInit --
|
||||
*
|
||||
* Called manually to create a keyboard device for the joystick
|
||||
*
|
||||
***************************************************************************
|
||||
*/
|
||||
InputInfoPtr
|
||||
jstkKeyboardPreInit(InputDriverPtr drv, IDevPtr _dev, int flags)
|
||||
{
|
||||
LocalDevicePtr local = NULL;
|
||||
IDevPtr dev = NULL;
|
||||
char name[512] = {0};
|
||||
|
||||
local = xf86AllocateInput(drv, 0);
|
||||
if (!local) {
|
||||
goto SetupProc_fail;
|
||||
}
|
||||
|
||||
dev = xcalloc(sizeof(IDevRec), 1);
|
||||
strcpy(name, _dev->identifier);
|
||||
strcat(name, " (keys)");
|
||||
dev->identifier = xstrdup(name);
|
||||
dev->driver = xstrdup(_dev->driver);
|
||||
dev->commonOptions = (pointer)xf86optionListDup(_dev->commonOptions);
|
||||
dev->extraOptions = (pointer)xf86optionListDup(_dev->extraOptions);
|
||||
|
||||
local->name = dev->identifier;
|
||||
local->flags = XI86_KEYBOARD_CAPABLE;
|
||||
local->device_control = jstkKeyboardDeviceControlProc;
|
||||
local->read_input = NULL;
|
||||
local->close_proc = NULL;
|
||||
local->control_proc = NULL;
|
||||
local->switch_mode = NULL;
|
||||
local->conversion_proc = NULL;
|
||||
local->fd = -1;
|
||||
local->dev = NULL;
|
||||
local->private = NULL;
|
||||
local->type_name = XI_JOYSTICK;
|
||||
local->history_size = 0;
|
||||
local->always_core_feedback = 0;
|
||||
local->conf_idev = dev;
|
||||
|
||||
xf86CollectInputOptions(local, NULL, NULL);
|
||||
xf86OptionListReport(local->options);
|
||||
xf86ProcessCommonOptions(local, local->options);
|
||||
|
||||
|
||||
/* return the LocalDevice */
|
||||
local->flags |= XI86_CONFIGURED;
|
||||
|
||||
return (local);
|
||||
|
||||
SetupProc_fail:
|
||||
if (local)
|
||||
local->private = NULL;
|
||||
if (dev) {
|
||||
if (dev->identifier) xfree(dev->identifier);
|
||||
if (dev->driver) xfree(dev->driver);
|
||||
xfree(dev);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
***************************************************************************
|
||||
*
|
||||
* jstkKeyboardUnInit --
|
||||
*
|
||||
* Called when the keyboard slave device gets removed
|
||||
*
|
||||
***************************************************************************
|
||||
*/
|
||||
void
|
||||
jstkKeyboardUnInit(InputDriverPtr drv,
|
||||
LocalDevicePtr local,
|
||||
int flags)
|
||||
{
|
||||
JoystickDevPtr device = (JoystickDevPtr) local->private;
|
||||
DBG(2, ErrorF("jstkKeyboardUnInit.\n"));
|
||||
|
||||
device->keyboard_device = NULL;
|
||||
local->private = NULL;
|
||||
|
||||
xf86DeleteInput(local, 0);
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,9 @@
|
||||
#ifndef __JSTK_KEY_H_INCLUDED__
|
||||
#define __JSTK_KEY_H_INCLUDED__
|
||||
|
||||
int jstkInitKeys(DeviceIntPtr pJstk, JoystickDevPtr priv);
|
||||
void jstkGenerateKeys(LocalDevicePtr device, KEYSCANCODES keys, char pressed);
|
||||
|
||||
InputInfoPtr jstkKeyboardPreInit(InputDriverPtr drv, IDevPtr dev, int flags);
|
||||
void jstkKeyboardUnInit(InputDriverPtr drv, LocalDevicePtr local, int flags);
|
||||
|
||||
#endif
|
||||
|
@ -41,31 +41,6 @@
|
||||
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* jstkGetButtonNumberInMap --
|
||||
*
|
||||
* Adds a button number to the button map and returns the index
|
||||
*
|
||||
***********************************************************************
|
||||
*/
|
||||
|
||||
int
|
||||
jstkGetButtonNumberInMap(JoystickDevPtr priv,
|
||||
int buttonnumber)
|
||||
{
|
||||
int j;
|
||||
for (j=1; j<=priv->buttonmap.size; j++)
|
||||
if (priv->buttonmap.map[j] == buttonnumber)
|
||||
break;
|
||||
if (j > MAXBUTTONS+1) return 0;
|
||||
priv->buttonmap.map[j] = buttonnumber;
|
||||
if (j > priv->buttonmap.size) priv->buttonmap.size = j;
|
||||
return j;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* jstkGetKeyNumberInMap --
|
||||
@ -75,7 +50,7 @@ jstkGetButtonNumberInMap(JoystickDevPtr priv,
|
||||
***********************************************************************
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
jstkGetKeyNumberInMap(JoystickDevPtr priv,
|
||||
KeySym keysym)
|
||||
{
|
||||
@ -102,7 +77,7 @@ jstkGetKeyNumberInMap(JoystickDevPtr priv,
|
||||
***********************************************************************
|
||||
*/
|
||||
|
||||
static JOYSTICKMAPPING
|
||||
static JSTK_MAPPING
|
||||
jstkGetAxisMapping(float *value, const char* param, const char* name)
|
||||
{
|
||||
if (sscanf(param, "%f", value)==0) {
|
||||
@ -110,17 +85,17 @@ jstkGetAxisMapping(float *value, const char* param, const char* name)
|
||||
*value *= -1.0;
|
||||
}
|
||||
if (strstr(param, "key") != NULL)
|
||||
return MAPPING_KEY;
|
||||
return JSTK_MAPPING_KEY;
|
||||
else if (strstr(param, "zx") != NULL)
|
||||
return MAPPING_ZX;
|
||||
return JSTK_MAPPING_ZX;
|
||||
else if (strstr(param, "zy") != NULL)
|
||||
return MAPPING_ZY;
|
||||
return JSTK_MAPPING_ZY;
|
||||
else if (strstr(param, "x") != NULL)
|
||||
return MAPPING_X;
|
||||
return JSTK_MAPPING_X;
|
||||
else if (strstr(param, "y") != NULL)
|
||||
return MAPPING_Y;
|
||||
return JSTK_MAPPING_Y;
|
||||
|
||||
return MAPPING_NONE;
|
||||
return JSTK_MAPPING_NONE;
|
||||
}
|
||||
|
||||
|
||||
@ -153,27 +128,32 @@ jstkParseButtonOption(const char* org,
|
||||
/* for (tmp = param; *tmp; tmp++) *tmp = tolower(*tmp); */
|
||||
|
||||
if (strcmp(param, "none") == 0) {
|
||||
button->mapping = MAPPING_NONE;
|
||||
button->mapping = JSTK_MAPPING_NONE;
|
||||
} else if (sscanf(param, "button=%d", &value) == 1) {
|
||||
button->mapping = MAPPING_BUTTON;
|
||||
button->buttonnumber = jstkGetButtonNumberInMap(priv, value);
|
||||
if (value<0 || value >BUTTONMAP_SIZE) {
|
||||
xf86Msg(X_WARNING, "%s: button number out of range (0..%d): %d.\n",
|
||||
name, BUTTONMAP_SIZE, value);
|
||||
} else {
|
||||
button->mapping = JSTK_MAPPING_BUTTON;
|
||||
button->buttonnumber = value;
|
||||
}
|
||||
} else if (sscanf(param, "axis=%15s", p) == 1) {
|
||||
p[15]='\0';
|
||||
fvalue = 1.0f;
|
||||
button->mapping = jstkGetAxisMapping(&fvalue, p, name);
|
||||
button->amplify = fvalue;
|
||||
button->currentspeed = 1.0f;
|
||||
if (button->mapping == MAPPING_NONE)
|
||||
if (button->mapping == JSTK_MAPPING_NONE)
|
||||
xf86Msg(X_WARNING, "%s: error parsing axis: %s.\n",
|
||||
name, p);
|
||||
} else if (sscanf(param, "amplify=%f", &fvalue) == 1) {
|
||||
button->mapping = MAPPING_SPEED_MULTIPLY;
|
||||
button->mapping = JSTK_MAPPING_SPEED_MULTIPLY;
|
||||
button->amplify = fvalue;
|
||||
} else if (sscanf(param, "key=%30s", p) == 1) {
|
||||
char *current, *next;
|
||||
p[30]='\0';
|
||||
current = p;
|
||||
button->mapping = MAPPING_KEY;
|
||||
button->mapping = JSTK_MAPPING_KEY;
|
||||
|
||||
for (value = 0; value < MAXKEYSPERBUTTON; value++) if (current != NULL) {
|
||||
unsigned key;
|
||||
@ -195,11 +175,11 @@ jstkParseButtonOption(const char* org,
|
||||
current = next;
|
||||
} else button->keys[value] = 0;
|
||||
} else if (strcmp(param, "disable-all") == 0) {
|
||||
button->mapping = MAPPING_DISABLE;
|
||||
button->mapping = JSTK_MAPPING_DISABLE;
|
||||
} else if (strcmp(param, "disable-mouse") == 0) {
|
||||
button->mapping = MAPPING_DISABLE_MOUSE;
|
||||
button->mapping = JSTK_MAPPING_DISABLE_MOUSE;
|
||||
} else if (strcmp(param, "disable-keys") == 0) {
|
||||
button->mapping = MAPPING_DISABLE_KEYS;
|
||||
button->mapping = JSTK_MAPPING_DISABLE_KEYS;
|
||||
} else {
|
||||
xf86Msg(X_WARNING, "%s: error parsing button parameter.\n",
|
||||
name);
|
||||
@ -238,16 +218,16 @@ jstkParseAxisOption(const char* org,
|
||||
if (sscanf(tmp, "mode=%15s", p) == 1) {
|
||||
p[15] = '\0';
|
||||
if (strcmp(p, "relative") == 0) {
|
||||
axis->type = TYPE_BYVALUE;
|
||||
axis->type = JSTK_TYPE_BYVALUE;
|
||||
} else if (strcmp(p, "accelerated") == 0) {
|
||||
axis->type = TYPE_ACCELERATED;
|
||||
axis->type = JSTK_TYPE_ACCELERATED;
|
||||
axis->currentspeed = 1.0f;
|
||||
} else if (strcmp(p, "absolute") == 0) {
|
||||
axis->type = TYPE_ABSOLUTE;
|
||||
axis->type = JSTK_TYPE_ABSOLUTE;
|
||||
} else if (strcmp(p, "none") == 0) {
|
||||
axis->type = TYPE_NONE;
|
||||
axis->type = JSTK_TYPE_NONE;
|
||||
} else {
|
||||
axis->type = TYPE_NONE;
|
||||
axis->type = JSTK_TYPE_NONE;
|
||||
xf86Msg(X_WARNING, "%s: \"%s\": error parsing mode.\n",
|
||||
name, param);
|
||||
}
|
||||
@ -260,28 +240,32 @@ jstkParseAxisOption(const char* org,
|
||||
p[15] = '\0';
|
||||
fvalue = 1.0f;
|
||||
axis->mapping = jstkGetAxisMapping(&fvalue, p, name);
|
||||
if ((axis->type == TYPE_ABSOLUTE) &&
|
||||
if ((axis->type == JSTK_TYPE_ABSOLUTE) &&
|
||||
((fvalue <= 1.1)&&(fvalue >= -1.1))) {
|
||||
if (axis->mapping == MAPPING_X)
|
||||
if (axis->mapping == JSTK_MAPPING_X)
|
||||
fvalue *= (int)screenInfo.screens[0]->width;
|
||||
if (axis->mapping == MAPPING_Y)
|
||||
if (axis->mapping == JSTK_MAPPING_Y)
|
||||
fvalue *= (int)screenInfo.screens[0]->height;
|
||||
}
|
||||
axis->amplify = fvalue;
|
||||
if (axis->mapping == MAPPING_NONE)
|
||||
if (axis->mapping == JSTK_MAPPING_NONE)
|
||||
xf86Msg(X_WARNING, "%s: error parsing axis: %s.\n",
|
||||
name, p);
|
||||
}else xf86Msg(X_WARNING, "%s: error parsing axis.\n",
|
||||
name);
|
||||
}
|
||||
|
||||
if ((tmp = strstr(param, "valuator")) != NULL ) {
|
||||
axis->valuator = 0; /* Will be renumbered appropriately on DEVICE_INIT */
|
||||
}
|
||||
|
||||
if ((tmp = strstr(param, "keylow=")) != NULL) {
|
||||
if (sscanf(tmp, "keylow=%30s", p) == 1) {
|
||||
char *current, *next;
|
||||
unsigned int key;
|
||||
p[30]='\0';
|
||||
current = p;
|
||||
axis->mapping = MAPPING_KEY;
|
||||
axis->mapping = JSTK_MAPPING_KEY;
|
||||
for (value = 0; value < MAXKEYSPERBUTTON; value++)
|
||||
if (current != NULL) {
|
||||
next = strchr(current, ',');
|
||||
@ -311,7 +295,7 @@ jstkParseAxisOption(const char* org,
|
||||
unsigned int key;
|
||||
p[30]='\0';
|
||||
current = p;
|
||||
axis->mapping = MAPPING_KEY;
|
||||
axis->mapping = JSTK_MAPPING_KEY;
|
||||
for (value = 0; value < MAXKEYSPERBUTTON; value++)
|
||||
if (current != NULL) {
|
||||
next = strchr(current, ',');
|
||||
|
@ -24,9 +24,6 @@
|
||||
#ifndef __JSTK_OPTIONS_H_INCLUDED__
|
||||
#define __JSTK_OPTIONS_H_INCLUDED__
|
||||
|
||||
int jstkGetButtonNumberInMap(JoystickDevPtr priv,
|
||||
int buttonnumber);
|
||||
|
||||
void jstkParseButtonOption(const char* org,
|
||||
JoystickDevPtr priv,
|
||||
int number,
|
||||
|
399
driver/xf86-input-joystick/src/jstk_properties.c
Normal file
399
driver/xf86-input-joystick/src/jstk_properties.c
Normal file
@ -0,0 +1,399 @@
|
||||
/*
|
||||
* Copyright 2007-2008 by Sascha Hlusiak. <saschahlusiak@freedesktop.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Sascha Hlusiak not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. Sascha Hlusiak makes no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <xf86Module.h>
|
||||
|
||||
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
|
||||
|
||||
|
||||
|
||||
#include <misc.h>
|
||||
#include <xf86.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <xf86Xinput.h>
|
||||
#include <exevents.h>
|
||||
|
||||
#include "jstk.h"
|
||||
#include "jstk_properties.h"
|
||||
#include "joystick-properties.h" /* definitions of properties */
|
||||
|
||||
|
||||
static Atom prop_debuglevel = 0;
|
||||
static Atom prop_numbuttons = 0;
|
||||
static Atom prop_numaxes = 0;
|
||||
static Atom prop_mouse_enabled = 0;
|
||||
static Atom prop_keys_enabled = 0;
|
||||
static Atom prop_axis_deadzone = 0;
|
||||
static Atom prop_axis_type = 0;
|
||||
static Atom prop_axis_mapping = 0;
|
||||
static Atom prop_axis_amplify = 0;
|
||||
static Atom prop_axis_keys_low = 0;
|
||||
static Atom prop_axis_keys_high = 0;
|
||||
static Atom prop_button_mapping = 0;
|
||||
static Atom prop_button_buttonnumber = 0;
|
||||
static Atom prop_button_amplify = 0;
|
||||
static Atom prop_button_keys = 0;
|
||||
|
||||
|
||||
#ifndef XATOM_FLOAT
|
||||
#define XATOM_FLOAT "FLOAT"
|
||||
#endif
|
||||
static Atom float_type = 0;
|
||||
|
||||
|
||||
static int
|
||||
jstkSetProperty(DeviceIntPtr pJstk, Atom atom, XIPropertyValuePtr val,
|
||||
BOOL checkonly)
|
||||
{
|
||||
InputInfoPtr pInfo = pJstk->public.devicePrivate;
|
||||
JoystickDevPtr priv = pInfo->private;
|
||||
int i;
|
||||
|
||||
if (atom == prop_debuglevel)
|
||||
{
|
||||
#if DEBUG
|
||||
if (val->size != 1 || val->format != 8 || val->type != XA_INTEGER)
|
||||
return BadMatch;
|
||||
if (!checkonly)
|
||||
{
|
||||
debug_level = *((INT8*)val->data);
|
||||
ErrorF("JOYSTICK: DebugLevel set to %d\n", debug_level);
|
||||
}
|
||||
#endif
|
||||
}else if (atom == prop_numbuttons)
|
||||
{
|
||||
if (val->size != 1 || val->format != 8 || val->type != XA_INTEGER)
|
||||
return BadMatch;
|
||||
if ((*((INT8*)val->data)) != priv->num_buttons)
|
||||
return BadMatch;
|
||||
return Success;
|
||||
}else if (atom == prop_numaxes)
|
||||
{
|
||||
if (val->size != 1 || val->format != 8 || val->type != XA_INTEGER)
|
||||
return BadMatch;
|
||||
if ((*((INT8*)val->data)) != priv->num_axes)
|
||||
return BadMatch;
|
||||
return Success;
|
||||
}else if (atom == prop_mouse_enabled)
|
||||
{
|
||||
if (val->size != 1 || val->format != 8 || val->type != XA_INTEGER)
|
||||
return BadMatch;
|
||||
if (!checkonly)
|
||||
{
|
||||
priv->mouse_enabled = (*((INT8*)val->data)) != 0;
|
||||
DBG(1, ErrorF("mouse_enabled set to %d\n", priv->mouse_enabled));
|
||||
}
|
||||
}else if (atom == prop_keys_enabled)
|
||||
{
|
||||
if (val->size != 1 || val->format != 8 || val->type != XA_INTEGER)
|
||||
return BadMatch;
|
||||
if (!checkonly)
|
||||
{
|
||||
priv->keys_enabled = (*((INT8*)val->data)) != 0;
|
||||
DBG(1, ErrorF("keys_enabled set to %d\n", priv->keys_enabled));
|
||||
}
|
||||
}else if (atom == prop_axis_deadzone)
|
||||
{
|
||||
INT32 *values;
|
||||
if (val->size != priv->num_axes || val->format != 32 || val->type != XA_INTEGER)
|
||||
return BadMatch;
|
||||
values = (INT32*)val->data;
|
||||
for (i =0; i<val->size; i++) /* Fail, if one value is out of range */
|
||||
if (values[i] > 30000 || values[i] < -30000)
|
||||
return BadValue;
|
||||
if (!checkonly)
|
||||
{
|
||||
for (i =0; i<val->size; i++) {
|
||||
priv->axis[i].deadzone = (values[i]<0)?(-values[i]):(values[i]);
|
||||
DBG(1, ErrorF("Deadzone of axis %d set to %d\n",i, priv->axis[i].deadzone));
|
||||
}
|
||||
}
|
||||
}else if (atom == prop_axis_type)
|
||||
{
|
||||
INT8 *values;
|
||||
if (val->size != priv->num_axes || val->format != 8 || val->type != XA_INTEGER)
|
||||
return BadMatch;
|
||||
if (!checkonly)
|
||||
{
|
||||
values = (INT8*)val->data;
|
||||
for (i =0; i<val->size; i++) {
|
||||
priv->axis[i].type = values[i];
|
||||
DBG(1, ErrorF("Type of axis %d set to %d\n",i, priv->axis[i].type));
|
||||
}
|
||||
}
|
||||
}else if (atom == prop_axis_mapping)
|
||||
{
|
||||
INT8 *values;
|
||||
if (val->size != priv->num_axes || val->format != 8 || val->type != XA_INTEGER)
|
||||
return BadMatch;
|
||||
if (!checkonly)
|
||||
{
|
||||
values = (INT8*)val->data;
|
||||
for (i =0; i<val->size; i++) {
|
||||
priv->axis[i].mapping = values[i];
|
||||
DBG(1, ErrorF("Mapping of axis %d set to %d\n",i, priv->axis[i].mapping));
|
||||
}
|
||||
}
|
||||
}else if (atom == prop_axis_amplify)
|
||||
{
|
||||
float *values;
|
||||
if (val->size != priv->num_axes || val->format != 32 || val->type != float_type)
|
||||
return BadMatch;
|
||||
if (!checkonly)
|
||||
{
|
||||
values = (float*)val->data;
|
||||
for (i =0; i<val->size; i++) {
|
||||
priv->axis[i].amplify = values[i];
|
||||
DBG(1, ErrorF("Amplify of axis %d set to %.3f\n", i, priv->axis[i].amplify));
|
||||
}
|
||||
}
|
||||
}else if (atom == prop_axis_keys_low)
|
||||
{
|
||||
/* FIXME */
|
||||
return BadValue;
|
||||
}else if (atom == prop_axis_keys_high)
|
||||
{
|
||||
/* FIXME */
|
||||
return BadValue;
|
||||
}else if (atom == prop_button_mapping)
|
||||
{
|
||||
INT8 *values;
|
||||
if (val->size != priv->num_buttons || val->format != 8 || val->type != XA_INTEGER)
|
||||
return BadMatch;
|
||||
if (!checkonly)
|
||||
{
|
||||
values = (INT8*)val->data;
|
||||
for (i =0; i<val->size; i++) {
|
||||
priv->button[i].mapping = values[i];
|
||||
DBG(1, ErrorF("Mapping of button %d set to %d\n",i, priv->button[i].mapping));
|
||||
}
|
||||
}
|
||||
}else if (atom == prop_button_buttonnumber)
|
||||
{
|
||||
CARD8 *values;
|
||||
if (val->size != priv->num_buttons || val->format != 8 || val->type != XA_INTEGER)
|
||||
return BadMatch;
|
||||
values = (CARD8*)val->data;
|
||||
for (i = 0; i<val->size; i++) {
|
||||
if (values[i] > BUTTONMAP_SIZE) {
|
||||
DBG(1, ErrorF("Button number out of range (0..%d): %d\n",
|
||||
BUTTONMAP_SIZE, values[i]));
|
||||
return BadValue;
|
||||
}
|
||||
}
|
||||
if (!checkonly)
|
||||
{
|
||||
for (i = 0; i<val->size; i++) {
|
||||
priv->button[i].buttonnumber =
|
||||
values[i];
|
||||
DBG(1, ErrorF("Button number of button %d set to %d\n",
|
||||
i,
|
||||
priv->button[i].buttonnumber));
|
||||
}
|
||||
}
|
||||
return Success;
|
||||
}else if (atom == prop_button_amplify)
|
||||
{
|
||||
float *values;
|
||||
if (val->size != priv->num_buttons || val->format != 32 || val->type != float_type)
|
||||
return BadMatch;
|
||||
if (!checkonly)
|
||||
{
|
||||
values = (float*)val->data;
|
||||
for (i =0; i<val->size; i++) {
|
||||
priv->button[i].amplify = values[i];
|
||||
DBG(1, ErrorF("Amplify of button %d set to %.3f\n", i, priv->button[i].amplify));
|
||||
}
|
||||
}
|
||||
}else if (atom == prop_button_keys)
|
||||
{
|
||||
/* FIXME */
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
/* property not handled, report success */
|
||||
return Success;
|
||||
}
|
||||
|
||||
Bool
|
||||
jstkInitProperties(DeviceIntPtr pJstk, JoystickDevPtr priv)
|
||||
{
|
||||
INT32 axes_values32[MAXAXES];
|
||||
INT8 axes_values8[MAXAXES];
|
||||
INT8 button_values8[MAXBUTTONS];
|
||||
float axes_floats[MAXAXES];
|
||||
float button_floats[MAXBUTTONS];
|
||||
int i;
|
||||
|
||||
XIRegisterPropertyHandler(pJstk, jstkSetProperty, NULL, NULL);
|
||||
|
||||
float_type = XIGetKnownProperty(XATOM_FLOAT);
|
||||
if (!float_type) {
|
||||
float_type = MakeAtom(XATOM_FLOAT, strlen(XATOM_FLOAT), TRUE);
|
||||
if (!float_type) {
|
||||
xf86Msg(X_WARNING, "%s: Failed to init float atom. "
|
||||
"Disabling support for float properties.\n", pJstk->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
/* Debug Level */
|
||||
prop_debuglevel = MakeAtom(JSTK_PROP_DEBUGLEVEL, strlen(JSTK_PROP_DEBUGLEVEL), TRUE);
|
||||
XIChangeDeviceProperty(pJstk, prop_debuglevel, XA_INTEGER, 8,
|
||||
PropModeReplace, 1,
|
||||
&debug_level,
|
||||
FALSE);
|
||||
XISetDevicePropertyDeletable(pJstk, prop_debuglevel, FALSE);
|
||||
#endif
|
||||
|
||||
/* priv->num_buttons */
|
||||
prop_numbuttons = MakeAtom(JSTK_PROP_NUMBUTTONS, strlen(JSTK_PROP_NUMBUTTONS), TRUE);
|
||||
XIChangeDeviceProperty(pJstk, prop_numbuttons, XA_INTEGER, 8,
|
||||
PropModeReplace, 1,
|
||||
&priv->num_buttons,
|
||||
FALSE);
|
||||
XISetDevicePropertyDeletable(pJstk, prop_numbuttons, FALSE);
|
||||
|
||||
|
||||
/* priv->num_axes */
|
||||
prop_numaxes = MakeAtom(JSTK_PROP_NUMAXES, strlen(JSTK_PROP_NUMAXES), TRUE);
|
||||
XIChangeDeviceProperty(pJstk, prop_numaxes, XA_INTEGER, 8,
|
||||
PropModeReplace, 1,
|
||||
&priv->num_axes,
|
||||
FALSE);
|
||||
XISetDevicePropertyDeletable(pJstk, prop_numaxes, FALSE);
|
||||
|
||||
|
||||
/* priv->mouse_enabled */
|
||||
prop_mouse_enabled = MakeAtom(JSTK_PROP_MOUSE_ENABLED, strlen(JSTK_PROP_MOUSE_ENABLED), TRUE);
|
||||
XIChangeDeviceProperty(pJstk, prop_mouse_enabled, XA_INTEGER, 8,
|
||||
PropModeReplace, 1,
|
||||
&priv->mouse_enabled,
|
||||
FALSE);
|
||||
XISetDevicePropertyDeletable(pJstk, prop_mouse_enabled, FALSE);
|
||||
|
||||
/* priv->keys_enabled */
|
||||
prop_keys_enabled = MakeAtom(JSTK_PROP_KEYS_ENABLED, strlen(JSTK_PROP_KEYS_ENABLED), TRUE);
|
||||
XIChangeDeviceProperty(pJstk, prop_keys_enabled, XA_INTEGER, 8,
|
||||
PropModeReplace, 1,
|
||||
&priv->keys_enabled,
|
||||
FALSE);
|
||||
XISetDevicePropertyDeletable(pJstk, prop_keys_enabled, FALSE);
|
||||
|
||||
/* priv->axis[].deadzone */
|
||||
for (i=0;i<priv->num_axes;i++)
|
||||
axes_values32[i] = priv->axis[i].deadzone;
|
||||
prop_axis_deadzone = MakeAtom(JSTK_PROP_AXIS_DEADZONE, strlen(JSTK_PROP_AXIS_DEADZONE), TRUE);
|
||||
XIChangeDeviceProperty(pJstk, prop_axis_deadzone, XA_INTEGER, 32,
|
||||
PropModeReplace, priv->num_axes,
|
||||
axes_values32,
|
||||
FALSE);
|
||||
XISetDevicePropertyDeletable(pJstk, prop_axis_deadzone, FALSE);
|
||||
|
||||
/* priv->axis[].type */
|
||||
for (i=0;i<priv->num_axes;i++)
|
||||
axes_values8[i] = priv->axis[i].type;
|
||||
prop_axis_type = MakeAtom(JSTK_PROP_AXIS_TYPE, strlen(JSTK_PROP_AXIS_TYPE), TRUE);
|
||||
XIChangeDeviceProperty(pJstk, prop_axis_type, XA_INTEGER, 8,
|
||||
PropModeReplace, priv->num_axes,
|
||||
axes_values8,
|
||||
FALSE);
|
||||
XISetDevicePropertyDeletable(pJstk, prop_axis_type, FALSE);
|
||||
|
||||
/* priv->axis[].mapping */
|
||||
for (i=0;i<priv->num_axes;i++)
|
||||
axes_values8[i] = (INT8)priv->axis[i].mapping;
|
||||
prop_axis_mapping = MakeAtom(JSTK_PROP_AXIS_MAPPING, strlen(JSTK_PROP_AXIS_MAPPING), TRUE);
|
||||
XIChangeDeviceProperty(pJstk, prop_axis_mapping, XA_INTEGER, 8,
|
||||
PropModeReplace, priv->num_axes,
|
||||
axes_values8,
|
||||
FALSE);
|
||||
XISetDevicePropertyDeletable(pJstk, prop_axis_mapping, FALSE);
|
||||
|
||||
/* priv->axis[].amplify */
|
||||
if (float_type) {
|
||||
for (i=0;i<priv->num_axes;i++)
|
||||
axes_floats[i] = priv->axis[i].amplify;
|
||||
prop_axis_amplify = MakeAtom(JSTK_PROP_AXIS_AMPLIFY, strlen(JSTK_PROP_AXIS_AMPLIFY), TRUE);
|
||||
XIChangeDeviceProperty(pJstk, prop_axis_amplify, float_type, 32,
|
||||
PropModeReplace, priv->num_axes, axes_floats,
|
||||
FALSE);
|
||||
XISetDevicePropertyDeletable(pJstk, prop_axis_amplify, FALSE);
|
||||
}
|
||||
|
||||
/* priv->axis[].keys_low */
|
||||
/* FIXME: prop_axis_keys_low */
|
||||
|
||||
/* priv->axis[].keys_high */
|
||||
/* FIXME: prop_axis_keys_high */
|
||||
|
||||
|
||||
|
||||
|
||||
/* priv->button[].mapping */
|
||||
for (i=0;i<priv->num_buttons;i++)
|
||||
button_values8[i] = (INT8)priv->button[i].mapping;
|
||||
prop_button_mapping = MakeAtom(JSTK_PROP_BUTTON_MAPPING, strlen(JSTK_PROP_BUTTON_MAPPING), TRUE);
|
||||
XIChangeDeviceProperty(pJstk, prop_button_mapping, XA_INTEGER, 8,
|
||||
PropModeReplace, priv->num_buttons,
|
||||
button_values8,
|
||||
FALSE);
|
||||
XISetDevicePropertyDeletable(pJstk, prop_button_mapping, FALSE);
|
||||
|
||||
/* priv->button[].buttonnumber */
|
||||
for (i=0;i<priv->num_buttons;i++) {
|
||||
int index = priv->button[i].buttonnumber;
|
||||
if (index>=0 && index<=MAXBUTTONS)
|
||||
button_values8[i] = (CARD8)index;
|
||||
else button_values8[i] = 0;
|
||||
}
|
||||
prop_button_buttonnumber = MakeAtom(JSTK_PROP_BUTTON_BUTTONNUMBER, strlen(JSTK_PROP_BUTTON_BUTTONNUMBER), TRUE);
|
||||
XIChangeDeviceProperty(pJstk, prop_button_buttonnumber, XA_INTEGER, 8,
|
||||
PropModeReplace, priv->num_buttons,
|
||||
button_values8,
|
||||
FALSE);
|
||||
XISetDevicePropertyDeletable(pJstk, prop_button_buttonnumber, FALSE);
|
||||
|
||||
/* priv->button[].amplify */
|
||||
if (float_type) {
|
||||
for (i=0;i<priv->num_buttons;i++)
|
||||
button_floats[i] = priv->button[i].amplify;
|
||||
prop_button_amplify = MakeAtom(JSTK_PROP_BUTTON_AMPLIFY, strlen(JSTK_PROP_BUTTON_AMPLIFY), TRUE);
|
||||
XIChangeDeviceProperty(pJstk, prop_button_amplify, float_type, 32,
|
||||
PropModeReplace, priv->num_buttons, button_floats,
|
||||
FALSE);
|
||||
XISetDevicePropertyDeletable(pJstk, prop_button_amplify, FALSE);
|
||||
}
|
||||
|
||||
/* priv->button[].keys */
|
||||
/* FIXME: prop_button_keys */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif
|
31
driver/xf86-input-joystick/src/jstk_properties.h
Normal file
31
driver/xf86-input-joystick/src/jstk_properties.h
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2007-2008 by Sascha Hlusiak. <saschahlusiak@freedesktop.org>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Sascha Hlusiak not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. Sascha Hlusiak makes no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __JSTK_PROPERTIES_INCLUDED__
|
||||
#define __JSTK_PROPERTIES_INCLUDED__
|
||||
|
||||
#include "jstk.h"
|
||||
|
||||
Bool jstkInitProperties(DeviceIntPtr pJstk, JoystickDevPtr priv);
|
||||
|
||||
#endif
|
7
driver/xf86-input-joystick/xorg-joystick.pc.in
Normal file
7
driver/xf86-input-joystick/xorg-joystick.pc.in
Normal file
@ -0,0 +1,7 @@
|
||||
prefix=@prefix@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: xorg-joystick
|
||||
Description: X.Org joystick input driver.
|
||||
Version: @PACKAGE_VERSION@
|
||||
Cflags: -I${includedir}
|
Loading…
Reference in New Issue
Block a user