Commit Graph

22 Commits

Author SHA1 Message Date
Jonathan Toomim
88c8042932 input_common: Redesign mouse->stick panning for better responsiveness
Previously, the mouse processing code had some issues that reduced mouse    |
control quality. No matter how you configured it or how you used the mouse,
it was impossible to be able to make both fine inputs and maximum inputs to
the control stick with the same configuration, as inputs were clamped to the
range, and *outputs* were multiplied by the sensitivity setting. It was also
impossible to make brief inputs, as two built-in exponential moving average
filters in the mouse driver caused any mouse inputs, no matter how brief, to
continue to produce stick outputs for several hundred milliseconds before
dissipating.

This commit is an attempt to address those issues. With this commit, an
entirely different model of processing inputs is used. Instead of applying
the sesnsitivity to the stick output, this commit applies the sensitivity at
the beginning of processing to the mouse input. Next, inputs from the mouse
are accumulated into a buffer variable. When the stick is updated, stick
output is clamped to the range of the stick, and that value is subtracted
from the input buffer. Any *excess* motion still remaining in the buffer gets
decayed exponentially (similar to one of the exponential moving averages
before). This gives a good compromise between responsiveness (brief mouse
movement causes a brief stick response) and inertia (large mouse movement
which exceeds the stick's instantaneous dynamic range causes stick movement
that persists for a short time afterwards, mimicking inertia). Finally, to
improve the linearity of the response, the stick motion is square-rooted to
amplify small movements.

This commit changes the semantics of the sensitivity option. It's no longer
a percent, and "100(%)" no longer means anything special, so the input
configuration UI has been changed to allow values up to 10,000 instead of
being limited to 100. The changes to the filtration also affect the
sensitivity. There are some magic constants in the code to try to keep the
sensitivity about the same with a given value, but it's not exact, and users
are encouraged to play around with it again on the new code.
2023-05-23 02:49:18 -07:00
Valeri
60c4032b68 input_common: minor fix to mouse movement 2023-04-14 21:27:35 +03:00
Liam
600f325d87 general: fix spelling mistakes 2023-03-12 11:33:01 -04:00
german77
9a9e5844d3 input_common: Increase mouse sensitivity range 2023-03-07 19:31:52 -06:00
Narr the Reg
673accd630 input_common: Implement dedicated motion from mouse 2023-02-21 21:55:22 -06:00
Narr the Reg
17207939e5 input_common: Split mouse input into individual devices 2023-02-16 14:22:13 -06:00
Liam
9737615948 general: fix compile for Apple Clang 2022-11-22 22:22:28 -05:00
Liam
35d3e7db2a common: remove "yuzu:" prefix from thread names 2022-10-03 18:43:56 -04:00
Morph
99ceb03a1c general: Convert source file copyright comments over to SPDX
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-23 05:55:32 -04:00
Morph
25db62ce15 general: Rename NewUUID to UUID, and remove the previous UUID impl
This completes the removal of the old UUID implementation.
2022-02-05 13:56:21 -05:00
Morph
cb30fe50cd input/hid: Migrate to the new UUID implementation 2022-02-05 13:18:41 -05:00
bunnei
eceee8e5f4 Merge pull request #7725 from german77/mouse_in_motion
input_common: Reintroduce motion from mouse and use button names
2022-01-18 18:16:27 -08:00
Valeri
a99f84f4b2 input_common: fix copy-paste error
Found by static analysis with PVS-Studio.
2022-01-17 11:31:38 +03:00
german77
9eab07f863 input_common: Reintroduce motion from mouse and use button names 2022-01-16 20:37:34 -06:00
Lioncash
2b92d22bda input_engine: std::move engine name where applicable
We can allow the name to be moved into, allowing allocations to be
avoided.
2021-12-13 09:05:50 -05:00
german77
746c85b560 input_common: Move button names to the frontend 2021-11-24 20:30:28 -06:00
german77
42949738f2 kraken: Address comments from review
Fix compiler bug
2021-11-24 20:30:28 -06:00
german77
f4e5f89e6f core/hid: Improve accuary of mouse implementation 2021-11-24 20:30:28 -06:00
german77
654d76e79e core/hid: Fully implement native mouse 2021-11-24 20:30:28 -06:00
german77
77fa4d4bf6 second commit lion review 2021-11-24 20:30:26 -06:00
german77
464c4d26ac settings: Fix mouse and keyboard mappings 2021-11-24 20:30:25 -06:00
german77
00834b84dd input_common: Rewrite mouse 2021-11-24 20:30:22 -06:00