mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-19 09:19:05 +02:00
Add axis event listener to the analog test screen.
This commit is contained in:
1 parent
c671b075d8
commit
afb82e3998
2 files changed
+17
-1
No files matched your search
@@ -432,6 +432,21 @@ bool AnalogTestScreen::key(const KeyInput &key) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AnalogTestScreen::axis(const AxisInput &axis) {
|
||||
// This is mainly to catch axis events that would otherwise get translated
|
||||
// into arrow keys, since seeing keyboard arrow key events appear when using
|
||||
// a controller would be confusing for the user.
|
||||
char buf[512];
|
||||
if (axis.value > AXIS_BIND_THRESHOLD || axis.value < -AXIS_BIND_THRESHOLD) {
|
||||
int value = axis.value > AXIS_BIND_THRESHOLD ? 1 : -1;
|
||||
snprintf(buf, sizeof(buf), "Axis: %d (value %1.3f) Device ID: %d",
|
||||
axis.axisId, axis.value, axis.deviceId);
|
||||
lastKeyEvent_->SetText(buf);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void AnalogTestScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
|
||||
Reference in new issue
Block a user