Commit graph

447 commits

Author SHA1 Message Date
Sam Lantinga
290c391df5 tree 0c86a223596d
parent 44e12dd8ee8e
author Edward Rudd <urkle@outoforder.cc> 1358030047 18000
committer Edward Rudd <urkle@outoforder.cc> 1358030047 18000
revision 6821
branch default

Fix a bad mapping from "axis" to "button"
2013-02-11 11:21:19 -08:00
Sam Lantinga
65399f4c26 tree 8cbca1e6b293
parent 7ddddb71cec9
author Edward Rudd <urkle@outoforder.cc> 1358030045 18000
committer Edward Rudd <urkle@outoforder.cc> 1358030045 18000
revision 6820
branch default

Consolidate iterating the SupportedControllers array

also fix memory leak when controller mapping not found
2013-02-11 11:20:49 -08:00
Sam Lantinga
e1f76ef0ea Fixed setting the GUID for Bluetooth joysticks 2013-02-01 17:09:01 -08:00
Sam Lantinga
4cec546dca Fixed crash when the game controller mapping hint is set - the hint was duplicated and not null terminated. 2013-01-25 14:25:19 -08:00
Sam Lantinga
f4294fd806 Improvements from Alfred:
- Added new SDL_HINT_ALLOW_TOPMOST hint, when set to "0" then never set the topmost bit on a window. Useful when debugging fullscreen issues.
- fixed crash in windows joystick scanning if we failed to load the xinput dll
- added support for SDL_WINDOW_FULLSCREEN_DESKTOP under windows
- synthesize relative mouse movements if directinput fails to send relative moves, happens under virtual box.
2012-12-31 09:30:15 -08:00
Sam Lantinga
29bfd0ab48 Load the runtime udev library, not the development one. 2012-12-14 18:50:07 +00:00
Sam Lantinga
80493dfae0 Only check SDL_SYS_JoystickNeedsPolling() if we know we don't need to poll for other reasons. This avoids a select() syscall on Linux if it isn't necessary. 2012-12-14 09:22:13 -08:00
Ryan C. Gordon
6b4cb17219 Corrected Linux joystick things, fixes assertion failure from testjoystick. 2012-12-13 22:26:30 -05:00
Ryan C. Gordon
d2b1601539 Corrected device instance value for Linux joysticks. 2012-12-13 22:18:32 -05:00
Ryan C. Gordon
22f3f2b927 Fixed compiler warning. 2012-12-11 19:25:35 -05:00
Ryan C. Gordon
7cb9995377 Minor sanity checking and tweaks in SDL_JoystickGetGUIDString(). 2012-12-11 18:46:09 -05:00
Sam Lantinga
2d04749a9c Fixed building joystick code on Mac OS X 2012-12-11 12:35:11 -08:00
Sam Lantinga
5f53c47559 Fixed joystick GUID renaming for other platforms 2012-12-11 12:16:28 -08:00
Sam Lantinga
af4d258edb Fixed compiling Linux code 2012-12-11 12:08:36 -08:00
Sam Lantinga
5ef567b795 Fixed permissions on joystick files 2012-12-11 11:59:08 -08:00
Sam Lantinga
89ef9e3168 Changes from Alfred:
- rename JoystickGUID -> SDL_JoystickGUID
- change SDL_JoystickGetGUIDString to take the string as an arg, rather than doing a malloc
2012-12-11 11:54:32 -08:00
Sam Lantinga
5417afcf11 Don't spam events if the axis values haven't changed 2012-12-11 10:49:54 -08:00
Ryan C. Gordon
c8713a62c1 Updated Linux joystick code to support hotplug, GUIDs, etc.
This uses libudev for hotplug, but it's optional, so we'll just try to find
 some reasonable defaults without it (maybe an older Linux box or under
 FreeBSD's Linux emulation?).
2012-12-11 12:07:06 -05:00
Ryan C. Gordon
d935bb9d4d Removed old Linux joystick API (/dev/js*).
The newer API (/dev/input/event/*) is 12+ years old at this point, and has
 been available since Linux 2.4.
2012-12-11 11:07:48 -05:00
Ryan C. Gordon
0dc1a837b5 Removed the "logical" Linux joystick code.
It's been forcibly disabled since 2009, since the kernel apparently splits
 these devices for us now, and apparently the code was crashing at the time
 (see hg changeset 11c079bb52a8).

Also, it was a ton of messy #ifdefs in this file!
2012-12-10 15:50:42 -05:00
Andreas Schiffler
d4bfe07a4f Update assert API in test lib; add to and harness; add test lib to VS2010 and VS2012 solution; fix VS2012 solution; fix compiler warning 2012-12-01 14:48:30 -08:00
Ryan C. Gordon
6ac6dd737a Move all DirectInput code from DI2 to DI8.
Fixes failing Haptic subsystem initialization on Windows.
2012-11-29 15:24:56 -05:00
Sam Lantinga
556c764047 Fixed crashes in new joystick code 2012-11-28 11:52:38 -08:00
Sam Lantinga
cf4a5b5570 Alfred Reynolds - add scanning of XInput for controller connectedness so we can detect when the wireless controller turns on and off, the usb side doesn't change when the controller goes away 2012-11-27 09:19:09 -08:00
Sam Lantinga
9ab24950fc Fixed compiler warnings 2012-11-27 01:09:18 -08:00
Sam Lantinga
b165aa8c74 Fixed compiler warnings 2012-11-27 01:07:44 -08:00
Sam Lantinga
03e08a6a79 Organized joystick hotplug code a bit.
Cleaned up names, return types, etc.
2012-11-27 00:58:12 -08:00
Sam Lantinga
1898cc34ab This should really fix it.. 2012-11-26 23:58:53 -08:00
Sam Lantinga
50a56c026a Fixed building with joysticks disabled 2012-11-26 23:58:23 -08:00
Sam Lantinga
cf0dfcbaa4 Fixed unused variable warning 2012-11-26 23:53:18 -08:00
Sam Lantinga
86e0e26475 The XInput code is only available in the DirectInput joystick driver. 2012-11-26 23:50:12 -08:00
Sam Lantinga
27d81d93e4 Hopefully fixed BSD joystick code 2012-11-26 23:41:50 -08:00
Sam Lantinga
c9f59a287d Completed adding new hotplug stubs for the joystick implementations 2012-11-26 22:27:49 -08:00
Sam Lantinga
a8966c167e Updated BSD joystick code for the new API 2012-11-26 22:09:58 -08:00
Sam Lantinga
3f29ebe82f Return an error if the joystick index isn't 0 on Android 2012-11-26 22:09:34 -08:00
Sam Lantinga
c6918ae961 Fixed building joystick code on Android 2012-11-26 22:02:01 -08:00
Sam Lantinga
968ccf93b1 Fixed iOS joystick support for new API 2012-11-26 21:11:28 -08:00
Sam Lantinga
3765f3223a Fixed joystick attached API call on Linux 2012-11-26 17:31:49 -08:00
Sam Lantinga
34b88dfaae Added hotplug joystick support and simplified game controller API, courtesy of Alfred Reynolds 2012-11-26 16:37:54 -08:00
Sam Lantinga
f380ecb137 Removed executable bit from source files 2012-09-27 14:35:28 -07:00
Ryan C. Gordon
816523a285 Fixed a bunch of compiler warnings with Cygwin/MingW. 2012-08-24 19:34:28 -04:00
Sam Lantinga
488a27f1b9 Fixed bug 1561 - BSD joystick: Increase the number of uhid devices to scan
Brad Smith 2012-08-01 20:10:19 PDT

The attached patch from the OpenBSD ports tree is to increase the number of
uhid devices to scan for joysticks. It's somewhat easy to exhaust the default
number of devices which are scanned.
2012-08-24 10:03:05 -07:00
Ryan C. Gordon
8912814135 Removed some unused variables that gcc 4.6.1 complains about. 2012-08-09 14:14:41 -04:00
Ryan C. Gordon
110c52e2b4 Fix from 1.2 branch: ignore bogus Linux evdev joystick axes. 2012-06-03 05:05:34 -04:00
Sam Lantinga
d0a7e39c3b FreeBSD compile fix
Robert Millan

src/joystick/bsd/SDL_sysjoystick.c makes the invalid assumption that
__FreeBSD_kernel__ implies presence of "ucr_data" struct member.  This
breaks recent versions of FreeBSD 10-CURRENT, FreeBSD 9-STABLE and
Debian GNU/kFreeBSD "wheezy/sid".
2012-02-15 21:06:45 -05:00
Sam Lantinga
68b32846b8 Fixed bug 1371 - DX joystick axis ordering fix
Alex Nankervis 2012-01-15 11:19:45 PST

DirectX joysticks can enumerate their axis out of order. This results in some
joysticks having vertical/horizontal swapped, for example (vertical axis gets
assigned to axis0). Joysticks that I've tested with this problem: XBOX 360
controller, Logitech Extreme 3D Pro.

Attached is a diff that fixes this by sorting the DX joystick objects by their
data offsets into the DX data structs. This puts the joystick objects into a
standard ordering (X axis -> axis0, Y axis -> axis1, and so on).
2012-01-15 15:48:27 -05:00
Sam Lantinga
40c6294290 Fixed bug 1368 - Enabling joystick subsystem cause an infinite loop
morgan.devel@gmail.com 2012-01-13 00:32:23 PST

The android version of SDL_SYS_JoystickUpdate doesn't check if there is
actually new data and always generate the SDL_JOYAXISMOTION event.
Consequently, doing a while(SDL_PollEvent()) will result in an endless loop.

The attached patch fix this issue.

It also scale the incoming values properly in the Sint16 range. The scale from
[-gravity;+gravity] is done directly in the java part because one may want to
map the sensor values with a non-linear method for example.
2012-01-13 20:57:35 -05:00
Sam Lantinga
5ef6f8e30f Fixed bug 1337 - joystick crash due to heap corruption with btnx 2012-01-01 16:58:00 -05:00
Sam Lantinga
028e5dcdbd Happy New Year! 2011-12-31 09:28:07 -05:00
Sam Lantinga
29177954e7 It works better if you compile it. 2011-11-29 02:28:34 -05:00