JACoders / OpenJK

Community effort to maintain and improve Jedi Academy (SP & MP) + Jedi Outcast (SP only) released by Raven Software
GNU General Public License v2.0
2.03k stars 615 forks source link

Shared Unix/Windows joystick code using SDL #227

Closed eezstreet closed 11 years ago

eezstreet commented 11 years ago

I propose that the code in SDL for joysticks be shared with win32. Otherwise, windows will have to have its own includes (ie, xinput/ directinput) which would otherwise be unneeded. I'd like to get started on better joystick support, which is why I ask.

xycaleth commented 11 years ago

How can you play with a joystick? O.o

eezstreet commented 11 years ago

It's feasible to play with a joystick, just not quite as easy. Anyway, I'm sure people will appreciate the fixed controller support.

Sent from my Windows Phone


From: Alex Lomailto:notifications@github.com Sent: ‎5/‎10/‎2013 6:13 AM To: Razish/OpenJKmailto:OpenJK@noreply.github.com Cc: eezstreetmailto:eezstreet@live.com Subject: Re: [OpenJK] Shared Unix/Windows joystick code using SDL (#227)

How can you play with a joystick? O.o


Reply to this email directly or view it on GitHub: https://github.com/Razish/OpenJK/issues/227#issuecomment-17713157

mrwonko commented 11 years ago

Does SDL support vibration? Does it have proper support for the 360 gamepad on Windows? (i.e. vibration & separate trigger axes, i.e. using XInput instead of DirectInput) If you do gamepad support, do it properly, and that sadly means doing both DirectInput and XInput (or using some library that does both).

eezstreet commented 11 years ago

SDL according to @Ensiform supports xinput on Linux/Mac as well as Windows, sans rumble/vibration. If we fix DirectInput this also means that we fix PS3 controllers using MotionInJoy by principle.

Sent from my Windows Phone


From: Willi Schinmeyermailto:notifications@github.com Sent: ‎5/‎10/‎2013 6:21 AM To: Razish/OpenJKmailto:OpenJK@noreply.github.com Cc: eezstreetmailto:eezstreet@live.com Subject: Re: [OpenJK] Shared Unix/Windows joystick code using SDL (#227)

Does SDL support vibration? Does it have proper support for the 360 gamepad? (i.e. vibration & separate trigger axes, i.e. using XInput instead of DirectInput) If you do gamepad support, do it properly, and that sadly means doing both DirectInput and XInput (or using some library that does both).


Reply to this email directly or view it on GitHub: https://github.com/Razish/OpenJK/issues/227#issuecomment-17713407

eezstreet commented 11 years ago

Sorry to double post, but if we get the second set of trap calls like I'm wanting ingame and working, mods could have the option to add vibration to various events using trap calls. Now that I think about it, I'm not 100% whether SDL has vibration support or not, but it very well might.

Sent from my Windows Phone


From: Willi Schinmeyermailto:notifications@github.com Sent: ‎5/‎10/‎2013 6:21 AM To: Razish/OpenJKmailto:OpenJK@noreply.github.com Cc: eezstreetmailto:eezstreet@live.com Subject: Re: [OpenJK] Shared Unix/Windows joystick code using SDL (#227)

Does SDL support vibration? Does it have proper support for the 360 gamepad? (i.e. vibration & separate trigger axes, i.e. using XInput instead of DirectInput) If you do gamepad support, do it properly, and that sadly means doing both DirectInput and XInput (or using some library that does both).


Reply to this email directly or view it on GitHub: https://github.com/Razish/OpenJK/issues/227#issuecomment-17713407

ensiform commented 11 years ago

I never said that @eezstreet. XInput is a windows only thing brah.

ensiform commented 11 years ago

Just fix controller support by basing off of: https://github.com/ioquake/ioq3/commit/9541fca8789e06d1a44d64fcb8d28c4b8df132f8 for windows.

eezstreet commented 11 years ago

So how does SDL support the Xbox 360 controller?

Sent from my Windows Phone


From: Ensiformmailto:notifications@github.com Sent: ‎5/‎10/‎2013 10:46 AM To: Razish/OpenJKmailto:OpenJK@noreply.github.com Cc: eezstreetmailto:eezstreet@live.com Subject: Re: [OpenJK] Shared Unix/Windows joystick code using SDL (#227)

I never said that @eezstreet. XInput is a windows only thing brah.


Reply to this email directly or view it on GitHub: https://github.com/Razish/OpenJK/issues/227#issuecomment-17724308

ensiform commented 11 years ago

I just showed you how. Sans dead zone.

shinyquagsire23 commented 11 years ago

I'd like to see this since JKA might be cool to play with an xbox controller.

@eezstreet In Linux, the Xbox (360) controller is just seen as a joystick with several buttons and 6 analog buttons: 4 for the joysticks (1 for X, one for Y) and two for the triggers (which are also triggerable as plain on/off buttons).

For the analog parts, a threshold modifier would be good to make sure the character doesn't drift off if the joystick is just a little bit to the left.

eezstreet commented 11 years ago

Xbox 360 controller doesn't contain any accelerometers.

Sent from my Windows Phone


From: Max Thomasmailto:notifications@github.com Sent: ‎5/‎10/‎2013 5:17 PM To: Razish/OpenJKmailto:OpenJK@noreply.github.com Cc: eezstreetmailto:eezstreet@live.com Subject: Re: [OpenJK] Shared Unix/Windows joystick code using SDL (#227)

I'd like to see this since JKA might be cool to play with an xbox controller.

@eezstreet In Linux, the Xbox (360) controller is just seen as a joystick with several buttons and 6 accelerometers (not sure if that's the right term), 4 for the joysticks (1 for X, one for Y) and two for the triggers which are also triggerable as buttons.

For the accelerometers, a threshold modifier would be good to make sure the character doesn't drift off it the accelerometer is just a little bit to the left.


Reply to this email directly or view it on GitHub: https://github.com/Razish/OpenJK/issues/227#issuecomment-17745074

shinyquagsire23 commented 11 years ago

@eezstreet I meant analog buttons, couldn't think of the word at the time.

eezstreet commented 11 years ago

Closed, this is not going to be ported to Windows, instead we'll use DirectInput as we always have. I have an XInput branch in my fork for Xbox 360 controller which will be given a proper pull request along with other ("awesome") joystick fixes, some of which are cross-platform.