Commit Graph
108 Commits
Author SHA1 Message Date
Gareth Francis e7b8cc2785 Preserve event timestamps in X11 input driver
The X11 XKeyEvent structure (and others) include a timestamp
field, with 1ms resolution.
This was previously ignored causing the input timestamps to be
set to the middle of each frame.
If the timestamps are passed through then the event timestamps are
not coupled to the framerate and the polling issues are resolved.
2018-06-08 17:19:51 +01:00
Gareth FrancisandMrThatKid 144fba2e15 Bugfix/1698 linux event m_bShutdown undefined (#1699)
* Fix build
2018-06-07 13:17:02 -07:00
Gareth FrancisandColby Klein 252e1e7b1f Initialise variables to ensure input thread is started (#1696)
* Initialise variables to ensure input thread is started

m_bShutdown was not initialised. This meant that the input
thread would never be started seemingly at random.

In my case m_bShutdown was always false when running in fullscreen
but not in windowed mode for some reason
2018-05-26 04:30:19 -07:00
AustenandColby Klein 631523ace3 XInput support for the DirectInput driver (#1443)
* XInput support for the DirectInput driver

The XBox360 controller driver for windows has a flaw where the DirectInput backwards-compatible driver registers dance pad arrows as a hat and will not allow opposite arrows to be pressed at the same time. This is not a problem in the XInput interface since the arrows are registered as a DPad and each arrow is a button.

This patch adds XInput support for the DirectInput driver. On initialization XInput controllers will be detected and registered first, followed by enumerating DirectInput devices. During DirectInput enumeration any XInput-capable controllers will be bypassed so that they aren't registered twice.

* Fix joystick input for xinput driver

Needed to compensate for deadzones, magnitude of the inputs, and that the Y axis was reversed.

* Remove unnecesarry using statement for vectors
2017-05-23 14:57:55 -07:00
Kyzentun Keeslala 7cce462dd1 Start event devices at JOY10 so that they won't overlap with joystick devices. 2016-02-15 16:58:36 -07:00
Kyzentun Keeslala 7a26044934 Changed DirectInput mouse input to use an if statement instead of a while loop to avoid input lockup. 2015-10-09 23:54:35 -06:00
Jason Felds b3a5a82b5c Bring us closer to working with MinGW again.
The biggest obstacle right now deals with FFMPEG. I insist on being able to utilize the git clone/submodule (5_1_0) section. I'm just struggling with the commands.

As part of this commit, some linux files are restored in the compilation chain. This is for consistency with the old Makefile approach.

Assistance will be needed at this point to complete MinGW support.
2015-09-27 17:07:15 -04:00
Kyzentun Keeslala e1eceda031 Moved AxisFix to GamePreferences so that the preference exists on all platforms and doesn't cause a crash on the Advanced Input Options screen on OS X. Preference does nothing on OS X for now. 2015-09-06 14:10:26 -06:00
Jason Felds e093d204c8 Use proper cmake detection of features.
This attempts to organize all needed items and places appropriate defines
in a single location. Redundant comparisons/defines were removed when noticed.

A few caveats, however:

* This may be better targeted towards the 5_1_0 branch instead of master right now.
* Cmake will run a little slower on configuration/generation now. That's due to the sanity checks it runs.
* There are some more checks to be added later, but this should be a solid start.

Thanks to the [libical](https://github.com/libical/libical) project for inspiration.
2015-09-05 10:51:17 -04:00
Fighter19 73ee19b7cf Adds option for an Axis Fix for some (PS2) adapters which map the D-Pad to Axis 2015-05-06 10:04:55 +02:00
Matt McCutchen cb7efb1570 getDevice: Do not read a dirent after calling closedir.
On my Fedora 20 system, closedir apparently frees the dirent, and
reading it afterwards returns garbage data.  This prevented my dance pad
from being detected.
2015-04-23 21:38:45 -04:00
Colin Wallace 8ed944368c Fix OSX key translation crash (#504) 2015-04-05 02:55:54 +00:00
Peter S. May a991ae18a0 SextetStream input and lights drivers. 2014-10-19 16:51:54 -04:00
Thai Pangsakulyanont 36aa012f03 fallback to the fallback when KeyCodeToChar does not work 2014-10-11 21:10:23 +07:00
Thai Pangsakulyanont 85f6f2e5d4 added the code that works. It is tested outside of StepMania 2014-10-11 14:34:05 +07:00
Thai Pangsakulyanont b0106312c4 remove untested code 2014-10-11 14:19:20 +07:00
Thai Pangsakulyanont a2e66a7803 Use Quarts to map raw keyboard to character code. 2014-10-11 13:49:43 +07:00
David Buckley 71a499481f Properly handle Linux event device button numbers
Old code would, by coincidence, map 1->16 to 1->16, then 17->32 to
1->32, leaving 1 and 17 on the same button number.

We still map 33->56 to 1->24, creating some overlap. But at least that's
because StepMania will have run out of buttons.

THIS PATCH WILL CHANGE THE CODES OF JOYSTICK BUTTONS 17 AND UP.
2014-04-27 17:19:31 +01:00
Ben "root" Anderson 6dcbcd1d7b Oh no you don't. 2014-01-22 00:10:50 -06:00
Ben "root" Anderson e011f8ca70 IH_Linux_Joystick: Make sure we have joysticks to manage before starting the thread. 2013-11-30 01:01:24 -06:00
Ben "root" Anderson 3cd3db7b6a IH_Linux_Joystick cleanup. Hack to make sure thread gets started. 2013-11-30 01:00:07 -06:00
Ben "root" Anderson 0e0922ad8e 1) Event -> LinuxEvent and Joystick -> LinuxJoystick 2) Rewritten Linux input device detection: introducing LinuxInputManager. It keeps IH_Linux_Event and IH_Linux_Joystick playing nice with each other, and will later be fundamental in hotplugging support. 2013-11-30 00:08:04 -06:00
Jason Felds 09f8219a67 Revert "Xcode 5 fixing, part 1."
This reverts commit bfab952b6a.
2013-11-06 23:33:31 -05:00
Jason Felds bfab952b6a Xcode 5 fixing, part 1.
Need someone on xcode 4.x to confirm this works.

Once this file gets fixed, the others will be removed.
2013-11-04 19:45:23 -05:00
Ben "root" Anderson 0b6fc17c27 Oops. Not sure how that compiled but okay. 2013-10-25 04:12:14 -05:00
Ben "root" Anderson 7608c814e4 GCC is very very picky about switch statements. 2013-10-25 03:59:55 -05:00
Shenjoku e666d8ee89 Upon further consideration I think it's best to just add all possible device
types and let the user try to use whatever they might have. Even if it can't be
mapped properly to something that will work it's still worth trying and
shouldn't cause any major problems (other than just not being able to play with
some weird devices, like lightguns for example).
2013-06-18 21:38:16 -07:00
Shenjoku 1a8b196121 Added another missing device type that some controllers are showing up as. 2013-06-18 10:52:46 -07:00
Shenjoku c56c40fad1 Added another missing case when enumerating joysticks, DI8DEVTYPE_SUPPLEMENTAL,
that should fix a lot more pads that were being reported as not being detected.
Also added some debug log messages that output each device's type and name
so in the future if other devices fail to be detected we can easily see what it
is in the info log.
2013-06-12 10:30:37 -07:00
Shenjoku b7f54a9fb0 Fixed another problem with a DirectInput function getting passed the wrong
constant when enumerating the joysticks. This should hopefully fix the
remaining problems.
2013-05-29 19:02:16 -07:00
Devin J. Pohly 64f59e616c This should never have been in defaults - sorry about that 2013-05-29 15:26:56 -04:00
Shenjoku 36a51a8359 Fixed some problems introduced in ba0d2d1 that were causing certain gamepads to
not get detected due to passing and checking the wrong constants when
enumerating the devices.
2013-05-28 20:52:45 -07:00
Shenjoku 910eafbf9f Fixed some problems introduced in ba0d2d1 that were causing joystick inputs to be
incorrectly mapped when using DirectInput.
2013-05-21 23:48:49 -07:00
Devin J. Pohly feb919f0bf Revert memory leak commits
5f7001e: "Added a new branch"
01456ed: "Fixed a lot of memory leaks"
dac4493: "Fixed all remaining memory leaks that I could figure out"
0792db7: "Removed the smnew macro and the call to _CrtSetDbgFlag()"

Some of these caused destructor-time problems due to static initialization
order fiasco and related issues.  Notably, the program would no longer exit on
OSX and had to be killed.

There were probably legitimate fixes in here, but since these are monolithic
commits it's too much work to extract them now.  Let's reapply them
individually and in the forward direction.
2013-04-27 00:05:14 -04:00
Shenjoku 0792db752a Removed the smnew macro and the call to _CrtSetDbgFlag() to get ready for
merging with the main branch.
2013-04-19 20:34:11 -07:00
Shenjoku 01456ed0b9 Fixed a lot of memory leaks caused by static globals never getting
deleted and some other objects not getting deleted properly due to missing
destructors.
2013-04-18 21:17:57 -07:00
Shenjoku 5f7001ef0a Added a new branch that implements support for outputting all memory leaks to
the debug output for the Debug and FastDebug project configurations. This
requires replacing all instances of new with a macro, smnew, that defines a
special form of new which outputs file and line number information along with
the memory leak details. This makes finding memory leaks much easier since you
can just double-click the leak in the output window and it will take you to the
line that caused it.
2013-04-17 20:42:29 -07:00
Shenjoku ba0d2d1838 Upgraded the DirectX 8 rendering to DirectX 9. Updated Direct Input to work with
the latest SDK as well.
2013-04-08 21:13:47 -07:00
Jason Felds b62c1509e0 ints should be reset to 0, not NULL.
I know it's a macro, but this is just begging
to be abused somehow.
2013-01-04 11:01:00 -05:00
Devin J. Pohly f6410abd43 X11: release all keys/buttons when window loses focus 2012-12-31 22:15:49 -05:00
Devin J. Pohly d9f61d919c answer some commented questions 2012-12-31 19:31:38 -05:00
Devin J. Pohly bd0e2074ad replace ASSERT(0) with useful fail messages 2012-12-27 16:59:35 -05:00
Jason Felds e01537405f war on -Werror, part 8: more informals.
General guide: if the parameter name and its typings
match almost exactly, the name goes away.
Otherwise, it's commented out to allow for some
documentation.
2012-12-27 00:00:28 -05:00
Devin J. Pohly 7f4e97d72a fix one more unused warning 2012-12-26 23:08:51 -05:00
Colby Klein a6020c8b1d Shut up the PIUIO driver from leaving a warning all the time. 2012-12-09 02:45:41 -08:00
Devin J. Pohly 07aa41e6ef add comments to clarify piuio inputdriver 2012-08-12 23:13:34 -04:00
Colby Klein fbada6f17f Add support for PIUIO Linux kernel driver, courtesy of djpohly. 2012-08-12 14:35:40 -07:00
AJ Kelly 201d6e8029 another patch from djpohly, this time to silence some pointless log output 2012-05-03 14:06:41 -05:00
AJ Kelly e2ab3d6493 various Linux updates, including making the default size of the splash window 512x96. 2011-08-22 15:50:56 -05:00
AJ Kelly e3b6b142f1 oops that could be dangerous if it wasn't handled 2011-08-17 16:39:21 -05:00