mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-26 15:53:35 +01:00
UI: Move to ScreenManager for mapping.
Otherwise we'll detect repeated axis for some devices and you won't be able to map what you want.
This commit is contained in:
1 parent
e1e5a8b49b
commit
b0de7ee0e1
4 files changed
+16
-14
No files matched your search
@@ -106,6 +106,17 @@ bool ScreenManager::key(const KeyInput &key) {
|
||||
|
||||
bool ScreenManager::axis(const AxisInput &axis) {
|
||||
std::lock_guard<std::recursive_mutex> guard(inputLock_);
|
||||
|
||||
// Ignore duplicate values to prevent axis values overwriting each other.
|
||||
uint64_t key = ((uint64_t)axis.axisId << 32) | axis.deviceId;
|
||||
// Center value far from zero just to ensure we send the first zero.
|
||||
// PSP games can't see higher resolution than this.
|
||||
int value = 128 + ceilf(axis.value * 127.5f + 127.5f);
|
||||
if (lastAxis_[key] == value) {
|
||||
return false;
|
||||
}
|
||||
lastAxis_[key] = value;
|
||||
|
||||
bool result = false;
|
||||
// Send center axis to every screen layer.
|
||||
if (axis.value == 0) {
|
||||
|
||||
Reference in new issue
Block a user