ryujinx-mirror/Ryujinx/Ui
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
..
App Initial Setup: Reload keys before verifying firmware (#1955) 2021-01-26 18:45:07 +01:00
Applet Fix Linux Icon (#1927) 2021-01-19 07:33:58 +11:00
Helper gui: Refactoring Part 1 (#1859) 2021-01-08 09:14:13 +01:00
Input Controller Input handling refactoring (#1751) 2021-02-21 00:22:55 +01:00
Resources Hotfix for Joy-Con Images (#2011) 2021-02-11 09:57:39 +01:00
Widgets Fix Linux Icon (#1927) 2021-01-19 07:33:58 +11:00
Windows Controller Input handling refactoring (#1751) 2021-02-21 00:22:55 +01:00
GLRenderer.cs Hide Cursor On Idle (#1993) 2021-02-15 22:48:21 +01:00
JoystickController.cs system: Make index 0 of keyboards in configuration 'all keyboards' 2020-05-03 15:00:29 +02:00
KeyboardController.cs Fix SL/SR typo in keyboard controller mapping (#1938) 2021-01-20 18:59:51 +01:00
MainWindow.cs Make windows DPI aware to display properly on high-resolution screens. (#1983) 2021-02-20 01:34:41 +01:00
MainWindow.glade Load default config when an invalid config is found (#1008) 2021-02-09 10:24:37 +01:00
StatusUpdatedEventArgs.cs gui: Refactoring Part 1 (#1859) 2021-01-08 09:14:13 +01:00