Improved Mouse mapping to analog stick - #7885
Conversation
… way the sensitivity (now speed) setting works
|
Currently I cannot get any mouse movement to work at all when binding the stick myself to the mouse or using the input profile provided. |
|
I will say, once this PR is complete, I will ask you to remove your input profile. I appreciate offering a preconfigured setup, but you could overwrite somebody elses profile, if they happen to name it the same, and we don't want to overwrite users custom configs. |
|
Would be nice to have multiple automatic configs per device, like how steam looks at device IDs and give multiple options. Though that would be low priority. |
|
Some kind of automatic mapping thing down the line might be good, but we'd need to decide on some "standard" config for games, taking in to account things like 10-keyless and hey board keyboards, then we can bake it in to the emulator as an "Automatic mapping" kind of thing. But then it's also a minefield of dealing with AZERTY,QWERTZ and DVORAK etc. So yeah, that kinda feature would need a lot of thought. Anyway, out of scope of this PR. |
|
Im using azerty and the current default keyboard layout kinda sucks in my case so I get it. |
If I start the PR build fresh, then:
If I copy in existing PCSX2.ini from my regular PCSX2 install, then:
Edited - I was not selecting the provided profile correctly, sorry for any confusion. |
|
That needs to be considered, as everybody will be upgrading from an existing install. So any out of bounds values (assuming that's what's going on here?) Are handled. |
|
of course the default ini file was just to facilitate testing, I will remove it when I get the greenlight. Regarding out of bound values, I will check again but the new implementation should be robust against those. |
|
how do I resolve conflicts in the .ui file without completely ditching my changes and re-doing everything? |
|
For me I usually look at the layout of the XML and try and work out how to piece my bit back in. I don't know an easy way, personally. The main thing is trying to fix the conflicting part from HEAD in your current code. |
|
I have already seen that I'll have to do it more or less from scratch. Perhaps we could decide a time window in which that file is locked? otherwise by the time it is tested it will have changed again :D |
|
tbh that doesn't change very often, I think it was just unfortunate timing :P |
|
on it |
# Conflicts: # pcsx2-qt/Settings/ControllerGlobalSettingsWidget.cpp # pcsx2-qt/Settings/ControllerGlobalSettingsWidget.ui
…hanged the way the sensitivity (now speed) setting works
| PointerAxisState& state = s_pointer_state[device][axis]; | ||
| const float delta = static_cast<float>(state.delta.exchange(0, std::memory_order_acquire)) / 65536.0f; | ||
| const float unclamped_value = delta * s_pointer_axis_scale[axis]; | ||
| delta = static_cast<float>(state.delta.exchange(0, std::memory_order_acquire)) / 65536.0f; |
There was a problem hiding this comment.
could possibly declare delta here and make it const
Description of Changes
Added a dead-zone compensation when mapping an analog stick to mouse movement. One can configure the amount of dead-zone that a game inherently has for the desired analog stick. When the mouse is moved, the stick position will immediately skip over the stick's dead zone. This prevents the previous situation in which the mouse becomes unresponsive for small movements that don't move the stick past the game's default dead-zone
Added an "inertia" control that allows the stick to briefly continue "moving" after the mouse has stopped moving IF AND ONLY IF the mouse movement speed has exceded the maximum speed of the analog stick. Changed
Rationale behind Changes
This PR should make FPS games a lot easier to play with mouse and keyboard. Small cursor movements now behave nearly identical to a true PC FPS game controlled with the mouse, while larger movements are still limited to the maximum stick speed, though the "inertia" control slightly masks this limitation
Suggested Testing Steps
I added controller configuration for debug, I would suggest to play FPS games with it like Killzone, Halflife, Black, Battlefield and so on and "see how it feels.