mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-07 14:19:19 +00:00
Merge pull request #12176 from LunaMoo/mouseImprovements
Mouse improvements
This commit is contained in:
commit
eeb3491214
@ -71,6 +71,7 @@ enum DefaultMaps {
|
||||
};
|
||||
|
||||
const float AXIS_BIND_THRESHOLD = 0.75f;
|
||||
const float AXIS_BIND_THRESHOLD_MOUSE = 0.01f;
|
||||
|
||||
typedef std::map<int, std::vector<KeyDef>> KeyMapping;
|
||||
|
||||
|
@ -884,9 +884,10 @@ void EmuScreen::processAxis(const AxisInput &axis, int direction) {
|
||||
KeyMap::AxisToPspButton(axis.deviceId, axis.axisId, -direction, &resultsOpposite);
|
||||
|
||||
int axisState = 0;
|
||||
if ((direction == 1 && axis.value >= AXIS_BIND_THRESHOLD)) {
|
||||
float threshold = axis.deviceId == DEVICE_ID_MOUSE ? AXIS_BIND_THRESHOLD_MOUSE : AXIS_BIND_THRESHOLD;
|
||||
if (direction == 1 && axis.value >= threshold) {
|
||||
axisState = 1;
|
||||
} else if (direction == -1 && axis.value <= -AXIS_BIND_THRESHOLD) {
|
||||
} else if (direction == -1 && axis.value <= -threshold) {
|
||||
axisState = -1;
|
||||
} else {
|
||||
axisState = 0;
|
||||
|
@ -246,8 +246,8 @@ void WindowsHost::PollControllers() {
|
||||
axisY.value = my;
|
||||
|
||||
if (GetUIState() == UISTATE_INGAME || g_Config.bMapMouse) {
|
||||
if (fabsf(mx) > 0.01f) NativeAxis(axisX);
|
||||
if (fabsf(my) > 0.01f) NativeAxis(axisY);
|
||||
NativeAxis(axisX);
|
||||
NativeAxis(axisY);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user