summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/evdev
AgeCommit message (Collapse)Author
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.
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-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-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
2015-09-26Common: Move asserts to their own headerLioncash
2015-08-15evdev: don't pass null path to the kernelTillmann Karras
2015-08-04Fix building with PCH disabled.Rohit Nirmal
2015-08-04Fix some warningsTillmann Karras
reorder, sign-compare, pessimizing-move
2015-08-02Stable device identifier for evdevGabriel Corona
2015-07-13Merge branch 'stable' into 'master'Scott Mansell
2015-07-08Fix building with PCH disabled.Rohit Nirmal
2015-07-07evdev: Delete rumble effects on the correct file descriptor.Scott Mansell
Was using m_id insted of m_fd. Also re-arrange the code so rumble effects always get deleted instead of just on stop commands.
2015-07-04evdev: fix -Wunused-private-field warningTillmann Karras
2015-07-01evdev: Support axis with ranges which extend below zero.Scott Mansell
2015-07-01Linux: Add an evdev based controller backend, to replace SDL.Scott Mansell