Commit Graph

245 Commits

Author SHA1 Message Date
0263435050 ControllerInterface/Device: Make DetectInput() a const member function
This doesn't actually modify object instance state, so it can be made
const.
2019-05-29 19:23:54 -04:00
27346fee8a ControllerInterface/Device: Take vector by const reference in DetectInput()
The vector is only ever queryied and it's contents aren't modified, so
there's no reason to take the vector by value. We can take a constant
reference to it to avoid unnecessary allocating.
2019-05-29 19:12:21 -04:00
246e2a77ce ControllerInterface/Device: std::move strings in constructor where applicable
Allows callers to move std::string values into the constructor,
potentially avoiding copies.
2019-05-29 18:46:49 -04:00
1355b43fd2 ControllerInterface/Device: Use std::string_view where applicable
In these cases, the given string is only ever compared against other
string, so std::string can be turned into a std::string_view to allow
non-allocating inputs.
2019-05-29 18:42:24 -04:00
7eaece8814 InputCommon/Device.cpp: Add missing include 2019-05-08 21:02:26 +02:00
98d808ab71 InputCommon/DInput.h: Add missing include 2019-05-08 21:01:46 +02:00
ff972e3673 Reformat repo to clang-format 7.0 rules 2019-05-06 18:48:04 +00:00
ab9ece9bca Replace MathUtil::Clamp with std::clamp 2019-05-04 23:12:17 +02:00
8c1310d1d1 ControllerInterface/DInput: Optimize cursor position updating. 2019-04-20 09:25:11 -05:00
be897b41a7 ControllerInterface: Rename full surface analog inputs to be more visually dissimilar from their underlying inputs. e.g. "Full Axis X+". 2019-04-13 08:45:19 -05:00
75e74315e6 Merge pull request #7689 from jordan-woyak/sdl-improve
ControllerInterface: SDL cleanups/fixes
2019-04-06 14:53:51 -04:00
2b6d718636 InputCommon: Fix Win32 init race. 2019-03-31 07:46:58 -05:00
eadbdd6bc3 ControllerInterface/Win32: Prevent devcies from losing their "id" on a hotplug event. 2019-03-29 09:04:16 -05:00
d26c1ce24d Add hotplug support to DInput and XInput controller backends 2019-03-29 08:01:40 -05:00
92ca6e124e Add ControllerInterface::Win32 to wrap XInput and DInput 2019-03-29 08:01:39 -05:00
672b582bec Merge pull request #7918 from spycrab/iokit_refactor
InputCommon/OSX: Refactor IOKit controller interface
2019-03-22 21:18:27 +01:00
80fd01c3c3 InputCommon/OSX: Refactor IOKit controller interface 2019-03-22 14:04:30 +01:00
0a1aacb5d0 Merge pull request #7906 from jordan-woyak/leak-fix
DolphinQt/InputCommon: Fix a few memory leaks.
2019-03-21 23:26:54 +00:00
b53636827b ControllerInterface: Unbreak DirectInput POV Hats having bad values on init. 2019-03-19 16:05:49 -05:00
725d34b2f0 DolphinQt/InputCommon: Fix a few memory leaks. 2019-03-17 18:31:41 -05:00
0bdfa19650 ControllerInterface: SDL: Replace unclear bool parameter with enum class. 2019-03-17 08:53:53 -05:00
4fb68c530b ControllerInterface: SDL cleanup and FF effect fixes. 2019-03-17 08:53:13 -05:00
c389d68186 ControllerInterface/DolphinQt: Make mapping "all devices" way less hacky. 2019-03-03 18:39:02 -06:00
48b69ca018 ControllerInterface: Input detection improvements. 2019-03-03 18:36:16 -06:00
e9130734af Merge pull request #7688 from jordan-woyak/evdev-improve
ControllerInterface: evdev: Cleanups and effect processing fixes.
2019-02-03 10:25:23 -08:00
4979220cf0 Android: Optimize rumble call
Moved rumble call to IDCache since GetMethodID is expensive
2019-01-26 09:38:35 -05:00
47d6406fd4 Android: Add touch to move pointer in overlay 2019-01-19 23:21:33 -05:00
6cc8775510 ControllerInterface: evdev: Replace unclear bool parameter with enum class. 2019-01-17 12:10:50 -06:00
52aa39991c ControllerInterface: evdev: Cleanup rumble effect processing so effects aren't removed and re-uploaded with every SetState() call. Split the "LeftRight" output into separate "Strong" and "Weak" outputs. Other minor cleanups. 2019-01-17 12:10:50 -06:00
a8bc6f9899 Merge pull request #7693 from jordan-woyak/hotplug-callback-fix
ControllerInterface: Hotplug callback fixes.
2019-01-16 21:00:48 +01:00
b2de98cad1 Merge pull request #7680 from jordan-woyak/dinput-axis-range
DirectInput: Use more than 8 bits of precision on axis inputs.
2019-01-16 18:52:11 +01:00
b425f86121 ControllerInterface: Allow hotplug callbacks to be unregistered and don't reload the entire config from the ini file on hotplug, just update the control references. This should fix a crash on shutdown on Android. 2019-01-10 18:32:16 -06:00
d3e1d2ea00 Merge pull request #7666 from jordan-woyak/input-shutdown-fix
ControllerInterface: Shutdown order and race condition fix.
2019-01-08 14:39:47 +01:00
02c649ba20 Android: Change all analoginputs to just inputs
Android doesn't report values for the inputs generated by FullAnalogInput so
there isn't a reason to add them as such. This also avoids a bug(for android)
where if there are three inputs(say 12, 11, and 121), and you generate a FullAnalogInput
with 12/11 then it will create another input with the name 121 which can cause conficts
with the real 121 input. This is probably not an issue on PC since most Axis inputs
are named and not numbered.
2019-01-07 21:52:39 -05:00
a7c45fb49e DirectInput: Use more than 8 bits of precision on axis inputs. 2019-01-06 08:14:37 -06:00
a995e2f5ba ControllerInterface: Set DInput FF effect parameters sanely. This fixes a crash with periodic effects and my GCPad adapter (probably a divide by zero behind the scenes). 2019-01-05 13:00:04 -06:00
25d43ffd98 ControllerInterface: Shutdown order and race condition fix. 2019-01-02 08:19:42 -06:00
0f19c4a40f ControllerInterface: DInput: Update force feedback effects in a thread. This should prevent slowdowns experienced by a handful of users. 2018-12-24 19:40:58 -06:00
52828901ef Core: Switch controller interface to render widget on booting
Previously, the Qt frontend would initialize the controller
interface on starting, resulting in the cursor position being
relative to the main window, instead of the render window.
2018-10-29 11:46:06 +10:00
a7f334dc2a ControllerInterface: Don't crash on non-X11 QPA 2018-10-29 11:46:06 +10:00
79051a28c4 evdev: simplify code
No need to check write access if we call open() right after which checks
that anyway. Also only get the device name once.
2018-10-08 19:51:29 +01:00
126ff8dc5f Android: Add rumble for phone
This currently only supports using the internal vibrate on a phone for rumble.
2018-09-07 08:54:03 -04:00
311d0442de InputCommon/XInput2: Increase mouse buttons to 32
Xlib supports many mouse buttons, though there are 9 standard buttons, and they aren't arranged like other mouse APIs. Using only 5 buttons was preventing the use of buttons besides left/right/middle click and the scroll wheel. Here's what all the standard buttons are:
1. left button
2. middle button (pressing the scroll wheel)
3. right button
4. turn scroll wheel up
5. turn scroll wheel down
6. push scroll wheel left
7. push scroll wheel right
8. 4th button (aka browser backward button)
9. 5th button (aka browser forward button)

The remaining button indices are non-standard and device-specific, and technically far more than 32 are supported, but this seems like a reasonable limit to avoid cluttering the list with tons of useless mouse buttons. What mouse has more than 32 buttons anyways?
2018-08-27 08:47:32 -04:00
932ca644aa Add hotplug support to SDL2 controller backend 2018-06-04 17:50:08 +02:00
7062967b5b SDLJoystick: store name on creation
Otherwise, Dolphin will crash when the joystick is removed.
2018-06-04 17:49:21 +02:00
0eb47e1071 CMake: make SDL a private dep of InputCommon 2018-06-04 17:49:21 +02:00
40bb9974f2 Reformat all the things! 2018-04-12 21:28:39 +02:00
50a476c371 Assert: Uppercase assertion macros
Macros should be all upper-cased. This is also kind of a wart that's
been sticking out for quite a while now (we avoid prefixing
underscores).
2018-03-14 22:03:12 -04:00
8adce86daa Merge pull request #6355 from myfreeweb/clang6-warning
Add -Wno-register to calm down clang 6.0.0 (C++17 mode)
2018-02-07 22:25:57 -08:00
9b201815f2 Ignore -Wregister to calm down recent clang and GCC (C++17 mode)
The 'register' keyword is used by a header included from Xlib (X11/XKBlib.h).
2018-02-05 14:43:07 +03:00