summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface
AgeCommit message (Collapse)Author
2017-11-19GCPadEmu: only connected if default device connectedMichael Maltese
This lets Dolphin know if a configured GameCube Controller should actually be treated as connected or not. Talked to @JMC47 a bit about this last night. My use-case is that all of my controllers are the same hardware (Xbox One controllers) so share the same configuration (modulo device number). Treating them all as always connected isn't a problem for most games, but in some (Smash Bros.) it forces me to go find a keyboard/mouse and unconfigure any controllers that I don't actually have connected. Hotplugging devices (works on macOS, at least) + this patch remove my need to ever touch the Controller Config dialog while in a game. This patch makes the following changes: - A new `BooleanSetting` in `GCPadEmu` called "Always Connected", which defaults to false. - `ControllerEmu` tracks whether the default device is connected on every call to `UpdateReferences()`. - `GCPadEmu.GetStatus()` now sets err bit to `PAD_ERR_NO_CONTROLLER` if the default device isn't connected. - `SIDevice_GCController` handles `PAD_ERR_NO_CONTROLLER` by imitating the behaviour of `SIDevice_Null` (as far as I can tell, this is the only use of the error bit from `GCPadStatus`). I wanted to add an OSD message akin to the ones when Wiimotes get connected/disconnected, but I haven't yet found where to put the logic.
2017-11-11evdev: Correctly calculate axis range for min values greater than 0.Scott Pleb
Axis range was previously calculated as max + abs(min), which relies on the assumption that min will not exceed 0. For (min, max) values like (0, 255) or (-128, 127), which I assume to be the most common cases, the range is correctly calculated as 255. However, given (20, 235), the range is erroneously calculated as 255, leading to axis values being normalized incorrectly. SDL already handles this case correctly. After changing the range calculation to max - min, the axis values received from the evdev backend are practically identical to the values received from the SDL backend.
2017-09-15Prevent multiple HID elements of same usage type on OSXArthur Carlsson
On OSX, iterate the HID device's elements and only store the last of each type to accommodate for flaky hardware
2017-09-09Common: Move version strings to their own headerLioncash
Ideally Common.h wouldn't be a header in the Common library, and instead be renamed to something else, like PlatformCompatibility.h or something, but even then, there's still some things in the header that don't really fall under that label This moves the version strings out to their own version header that doesn't dump a bunch of other unrelated things into scope, like what Common.h was doing. This also places them into the Common namespace, as opposed to letting them sit in the global namespace.
2017-08-24Implement GamePAd and MultiAxisController detectionNick
2017-08-23formatting cleanupNick
2017-08-22keyboard fixes v2Nick
2017-08-21Depreciate old OSX Keyboard and MouseNick
2017-08-17Merge pull request #5742 from ToadKing/fix-bad-controllersLeo Lam
Ignore capabilities reported by an XInput device
2017-08-09Ignore capabilities reported by an XInput deviceMichael Lelli
2017-08-01Fix axis not working with Switch Pro controller on macOSJocelyn Turcotte
Each axis would appear as multiple elements with 0 min/max. Filter the list of elements using the correct usage page like done for buttons.
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.