ryujinx/Ryujinx
Jose Padilla ad7d22777f
Controller Input handling refactoring (#1751)
* This should fix issue #1374 in Linux

Changes:
- Bind buttons by detecting the transition from down to up.
- Bind axis by detecting movement from value higher than 50% to a value lower than 50%.

Caveats:
- I have tested only with DS3 in Linux (Fedora 32).
- ZL and ZR detection works by accident. This code doesn't take negative axis into account.
  The reason it works is because axis are managed in absolute value. So when pressing ZL/ZR
  axis value goes from -1 to 1 (or 1 to 0 and back to 1) and this hits the axis detector.
- Likely I have broken all the other controllers xD (testing needed).

* Assign keyboardPressed

* Make a more robust detection of pressed buttons when using a controller

* Add interface to bind buttons from Joystick and Keyboard

* Fix style issues after code review by @AcK77  (Thanks!)

* Move new classes to Ryujinx.Ui.Input namespace

* Use explicit types instead of var

* Update Ryujinx/Ui/Input/JoystickButtonAssigner.cs

Co-authored-by: Mary <thog@protonmail.com>

* Update Ryujinx/Ui/Input/JoystickButtonAssigner.cs

Co-authored-by: Mary <thog@protonmail.com>

* Update Ryujinx/Ui/Input/JoystickButtonAssigner.cs

Co-authored-by: Mary <thog@protonmail.com>

* Update Ryujinx/Ui/Input/JoystickButtonAssigner.cs

Co-authored-by: Ac_K <Acoustik666@gmail.com>

* Add a new empty line before

* Up

Co-authored-by: Jose Padilla <jose@prensalink.com>
Co-authored-by: Mary <thog@protonmail.com>
Co-authored-by: Ac_K <Acoustik666@gmail.com>
2021-02-21 00:22:55 +01:00
..
Modules Fix Updater Icon On Linux (#1995) 2021-02-08 10:27:12 +11:00
Ui Controller Input handling refactoring (#1751) 2021-02-21 00:22:55 +01:00
_schema.json Hide Cursor On Idle (#1993) 2021-02-15 22:48:21 +01:00
Config.json Hide Cursor On Idle (#1993) 2021-02-15 22:48:21 +01:00
Program.cs Make windows DPI aware to display properly on high-resolution screens. (#1983) 2021-02-20 01:34:41 +01:00
Ryujinx.csproj gui: Refactoring Part 1 (#1859) 2021-01-08 09:14:13 +01:00
Ryujinx.ico Added Program Icon (#900) 2020-01-24 16:14:51 +01:00
THIRDPARTY.md Distribute with OpenAL Soft on Windows (#1847) 2020-12-31 09:08:09 +11:00