summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/evdev
AgeCommit message (Collapse)Author
7 daysReplace string concatination with `fmt::format`Dr. Dystopia
2024-11-03InputCommon: Rename AddAnalogInputs to AddFullAnalogSurfaceInputs.Jordan Woyak
2024-08-15Misc. Container Find Changesmitaclaw
2024-04-06evdev: close file descriptors in a separate threadTillmann Karras
For some reason Linux is surprisingly slow at closing file descriptors of event devices. This commit improves GUI startup times on my computer by about 1.5 seconds.
2023-12-18Input: Improve Controller Interface devices threadingFiloppi
This specific issue was already addressed by https://github.com/dolphin-emu/dolphin/pull/11635 though I felt like there was something more we could do, and wasn't too happy with the likelihood of devices update calls being skipped (due to `m_devices_population_mutex` being locked).
2022-11-01ControllerInterface: evdev InputBackend implementation.Jordan Woyak
2022-07-25StripSpaces: only strip spacesShawn Hoffman
StripWhitespace maintains old behavior
2022-01-09Common/Assert: Actually use the ASSERT_MSG's log type parameterPokechu22
Since it was unused, nonexistent values were used in a few places. I've replaced them.
2021-12-10Treewide: Adjust order of includesPokechu22
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
SPDX standardizes how source code conveys its copyright and licensing information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX tags are adopted in many large projects, including things like the Linux kernel.
2021-06-07ControllerInterface: make evdev use PlatformPopulateDevicesFiloppi
Also fix evdev non thread safe acces to static variables
2021-05-05InputCommon: replace SerialInterface log with ControllerInterfaceFiloppi
where appropriate. SerialInterface was a leftover from the past, and makes no sense to be used on actual/real controllers.
2021-03-07ControllerInterface: Fix unused-result warningDentomologist
Add ! before unused variables to 'use' them. Ubuntu-x64 emits warnings for unused variables because gcc decides it should ignore the void cast around them. See thread for discussion: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425
2020-10-23InputCommon: Migrate logging over to fmtLioncash
Continues the migration of the logging calls over to the fmt capable ones.
2020-09-08ControllerInterface: Combine evdev devices with the same physical location ↵Techjar
in addition to unique ID
2020-03-24Cleanup warnings of -Wmissing-declarationsJun Su
Add static to the functions which is not intentionally export to big scope.
2020-02-22InputCommon: Constify Device::Input::IsDetectable function.Jordan Woyak
2020-01-13ControllerInterface: Remove and re-add device when combining nodes.Jordan Woyak
2020-01-13ControllerInterface: Don't consider the empty string a valid unique ID.Jordan Woyak
2020-01-13ControllerInterface: Combine evdev devices with the same unique ID.Jordan Woyak
This works around Linux drivers for DS4 (Playstation 4) controllers splitting the device into three separate event nodes which makes configuration difficult. To prevent collisions of input names in combined devices more descriptive names are now used when possible.
2020-01-07Fix trailing whitespaceScott Mansell
2020-01-07Document the evdev "interesting" heuristic Scott Mansell
Was checking over this old code, and saw a comment calling me out for a lack of documentation. It might be half a decade late, but better late then never.
2019-11-10evdev: fix bad integer division.Jordan Woyak
2019-11-09InputCommon: Detect when evdev exposes acceleration/gyroscope data.Jordan Woyak
2019-07-23StringUtil: Use std::string_view moreJosJuice
2019-06-17InputCommon: Use nested namespace specifiers where applicableLioncash
2019-05-04Replace MathUtil::Clamp with std::clampLéo Lam
2019-04-06Merge pull request #7689 from jordan-woyak/sdl-improveJMC47
ControllerInterface: SDL cleanups/fixes
2019-03-17DolphinQt/InputCommon: Fix a few memory leaks.Jordan Woyak
2019-03-17ControllerInterface: SDL: Replace unclear bool parameter with enum class.Jordan Woyak
2019-03-03ControllerInterface: Input detection improvements.Jordan Woyak
2019-01-17ControllerInterface: evdev: Replace unclear bool parameter with enum class.Jordan Woyak
2019-01-17ControllerInterface: evdev: Cleanup rumble effect processing so effects ↵Jordan Woyak
aren't removed and re-uploaded with every SetState() call. Split the "LeftRight" output into separate "Strong" and "Weak" outputs. Other minor cleanups.
2018-10-08evdev: simplify codeTillmann Karras
No need to check write access if we call open() right after which checks that anyway. Also only get the device name once.
2018-04-12Reformat all the things!spycrab
2018-03-14Assert: Uppercase assertion macrosLioncash
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-02-05evdev: Always unref received udev devicesLéo Lam
Whenever udev_monitor_receive_device() returns a non-null pointer, the device must be unref'd after use with udev_device_unref(). We previously missed some unref calls for non-evdev devices.
2018-02-04evdev: Don't leak eventfd on shutdownLéo Lam
2018-02-04evdev: Fix select() callLéo Lam
It's not guaranteed that the eventfd is smaller than the monitor fd, because fds are not always monotonically allocated. To select() correctly in all cases, use the max between the monitor fd and eventfd.
2017-12-15Merge pull request #6166 from ligfx/invokedeviceschangedcallbacksLeo Lam
ControllerInterface: cleanup callbacks API and 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-11-10ControllerInterface: invoke callbacks in AddDevice/RemoveDeviceMichael M
Some backends already cause this to happen, so make it consistent across systems.
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.
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-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-10-23Fix -Wunused-result warningsLéo Lam
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-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.