Control: Add debug display, do assorted fixes.

This commit is contained in:
Henrik Rydgård committed 2023-03-31 20:12:48 +02:00
1 parent 025ec248e4
commit 48993f4f4b
9 files changed
+103 -43

No files matched your search

+10
View File
@@ -76,3 +76,13 @@ int GetAnalogYDirection(int deviceId) {
return configured->second;
return 0;
}
void InputMapping::FormatDebug(char *buffer, size_t bufSize) const {
if (IsAxis()) {
int direction;
int axis = Axis(&direction);
snprintf(buffer, bufSize, "Device: %d Axis: %d (%d)", deviceId, axis, direction);
} else {
snprintf(buffer, bufSize, "Device: %d Key: %d", deviceId, keyCode);
}
}