summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface
AgeCommit message (Collapse)Author
2017-06-11StringUtil: Make SplitString return by valueLéo Lam
Simpler usage.
2017-06-05Merge pull request #5276 from ligfx/macosheadlessshuffle2
Add headless support on macOS
2017-06-05Fix minor formatting issuesLéo Lam
These were not caught by the lint script while it was broken.
2017-06-03Device: Provide operator!= counterparts to operator== for DeviceQualifierLioncash
Makes comparison logic symmetric
2017-04-15Add headless support on macOSMichael Maltese
2017-02-20Add missing "functional" includeSteven Newbury
Building fails on GCC7 without an explicit
2017-02-07InputCommon: Extract ControlReference from ControllerInterfaceMichael Maltese
Better separation of concerns. Relegates `ControllerInterface` to enumerating input controls, and the new `ControlReference` deals with combining inputs and configuration expression parsing.
2017-01-23No longer need to //clang-format off for Windows headersMichael Maltese
2017-01-23Add includes for building on Windows without PCHMichael Maltese
2017-01-02macOS: Add missing includes to fix no-PCH buildhthh
2016-12-26evdev: reduce startup timeTillmann Karras
GetName() creates a new evdev device which calls tons of ioctls. But the main culprit is close() which for input devices appears to be a slow path in the kernel. This commit reduces PopulateDevices() by 50% on my laptop, but ~730 ms is still ridiculously slow for something that isn't needed right away.
2016-12-05evdev: set flag in a thread-safe wayTillmann Karras
2016-12-05evdev: fix shutdown hangTillmann Karras
Note: This probably means our approach of populating from udev isn't safe to be called multiple times.
2016-12-01Merge pull request #4362 from ligfx/osxhotplugAnthony
ControllerInterface: enable hotplugging on macOS
2016-11-30ControllerInterface: enable hotplugging on macOSMichael Maltese
2016-11-30ControllerInterface: replace Reinitialize with RefreshDevicesMichael Maltese
The SDL backend crashes when you close a joystick after SDL_Quit has been called. Some backends don't need to be shutdown and re-initialized everytime, we can just ask to enumerate devices again.
2016-11-30ControllerInterface: clear devices before shutting down backendsMichael Maltese
The SDL backend faults if it tries to close a joystick after SDL_Quit has been called.
2016-10-31Merge pull request #4405 from xrix4096/mac-unknown-joyaxisMarkus Wick
Make analog triggers on PS3 controllers accessible on Mac
2016-10-31Merge pull request #4376 from leoetlino/warning-fixMarkus Wick
Warning fixes
2016-10-30Use the IOHIDElement cookie as a part of the axis name for unknown axis. ↵Chris Pritchard
Previously the 'usage' value was used to identify the axis by name, but this is not unique. For example on a PS3 controller *all* axis other than the well known ones return a usage of '1' so there are 30 or more axis all named "1". This stops things such as analog triggers being usable. Using the element cookie uniquely identifies each axis and allows them to be assigned successfully as controls
2016-10-24Fix various comment typosSintendo
2016-10-23Fix -Wunused-result warningsLéo Lam
2016-10-03InputCommon: Fix formatting issues in QuartzLéo Lam
This wasn't caught by the lint script because it was broken (by me) at some point :( If it had been rebased, it wouldn't have passed lint
2016-10-03Merge pull request #4111 from EmptyChaos/startup-perf-langsshuffle2
InputCommon: Fix slow startup on some Windows systems with language packs (Issue 9744)
2016-10-03Merge pull request #4102 from ligfx/quartz_inputshuffle2
Add Quartz/CoreGraphics controller interface for default k&m events
2016-09-04InputCommon: Remove the Xlib backendJasper St. Pierre
The XInput2 backend is more performant, so let's default to it and remove the old, core-only backend.
2016-09-04XInput2: Only do a round trip when the mouse has movedJasper St. Pierre
This should cut down on round trips and blocking calls dramatically during gameplay.
2016-08-11InputCommon: Fix slow startup on some Windows systemsEmptyChaos
Rewrite GetXInputGUIDS to use SetupAPI instead of WMI Queries. When using a language pack where the system language and user/program language differ, Windows starts taking a VERY long time (10+ seconds) to complete Queries for Win32_PNPEntity objects (it's probably translating every single string since it transfers every single one from the WMI server into memory in the program). Fixes Issue 9744.
2016-08-09And pull KeycodeToName into its own functionMichael Maltese
2016-08-09use a std::map instead of running through the AOSMichael Maltese
2016-08-09use std::to_string instead of sstreamMichael Maltese
2016-08-09clang-format and cleaning up Key::GetNameMichael Maltese
2016-08-09style fixesMichael Maltese
2016-08-08Add Quartz/CoreGraphics controller interface for default k&m eventsMichael Maltese
2016-07-30InputConfigDiag: Don't prevent closing dialog if device not foundLéo Lam
There is no reason to prevent the user from closing the config dialog if the device is not found. It's not very good UX… Also fixes ExpressionParser to return NO_DEVICE if the device doesn't exist instead of SUCCESS.
2016-07-29evdev: Add hotplugging supportLéo Lam
This adds hotplugging support to the evdev input backend. We use libudev to monitor changes to input devices in a separate thread. Removed devices are removed from the devices list, and new devices are added to the list. The effect is that controllers are usable immediately after plugging them without having to manually refresh devices (if they were configured to be used, of course).
2016-07-29ControllerInterface: Don't block on UpdateInput()Léo Lam
Changes UpdateInput() to skip if we can't lock the mutex, instead of potentially blocking the CPU thread and causing a short but noticeable frame drop.
2016-07-29ControllerInterface: Add RemoveDevice()Léo Lam
This adds RemoveDevice() to ControllerInterface, fixes ExpressionParser and some other code to support device removals without crashing, and adds an IsValid() method to Device, to prepare for hotplugging.
2016-07-29ControllerInterface: Add a way to register callbacksLéo Lam
This adds RegisterHotplugCallback() to register a callback which will be invoked by the input backends' hotplug threads when there is a new device, so that Core (GCKeyboard, GCPad, Wiimote, Hotkey) can reload the configuration without adding a dependency to Core from InputCommon.
2016-07-14ControllerInterface: Make the ID assigning code commonLéo Lam
This makes the device ID assigning code common to all backends, by moving it to AddDevice() instead of copy-pasting or replicating the logic in the backends. Also, to prepare for hotplugging, instead of relying on a name usage count, the new ID assigning system always starts from ID 0 and tries to assign the first ID that is not used.
2016-07-12Strip whitespace from Evdev and OSX controller names.Scott Mansell
2016-07-11evdev: Clamp axis values to the 0.0-1.0 rangeLéo Lam
The values are expected to be in the 0.0-1.0 range (as indicated by the comment), and other parts of Dolphin also expect it to be in that range since the "full" axis has a -1.0 to 1.0 range. However, this is not always the case and fvalue can end up being outside of the range. This clamps fvalue to always be in the 0.0 and 1.0 range.
2016-06-26Merge pull request #3943 from ShadowsFriend/nopch-fixMat M
ControllerInterface: Include memory to fix building without pch
2016-06-25Device: Use std::tie for DeviceQualifier's operator==Lioncash
2016-06-26ControllerInterface: Include memory to fix building without pchChristian Widmer
All affected files use shared_ptr but do not include memory which breaks building without precompiled headers.
2016-06-25ControllerInterface: Switch to std::shared_ptrLéo Lam
Small cleanup by using std::shared_ptr and getting rid of ciface.Devices() which just returned the m_devices (which defeats the point of making m_devices protected). Incidentally, this should make the code safer when we have different threads accessing devices in the future (for hotplug?). A lot of code use Device references directly so there is no easy way to remove FindDevice() and make those unique_ptrs.
2016-06-25Fix a small formatting issueLéo Lam
2016-06-25ControllerInterface: Add synchronisationLéo Lam
Since we may have to add/access devices from different threads, this adds synchronisation to anything that touches m_devices.
2016-06-25ControllerInterface: Don't pass m_devices to the backendsLéo Lam
Previously, the devices vector would be passed to all backends. They would then manually push_back to it to add new devices. This was fine but caused issues when trying to add synchronisation. Instead, backends now call AddDevice() to fill m_devices so that it is not accessible from the outside.
2016-06-24Reformat all the things. Have fun with merge conflicts.Pierre Bourdon