Fixed an issue where touch input was not logged correctly

This commit is contained in:
Leon Styhre 2024-01-14 22:18:21 +01:00
parent c27ee24cc4
commit ba7874b0e7
2 changed files with 10 additions and 2 deletions

View file

@ -28,6 +28,8 @@ std::string InputConfig::inputTypeToString(InputType type)
return "button"; return "button";
case TYPE_KEY: case TYPE_KEY:
return "key"; return "key";
case TYPE_TOUCH:
return "touch-button";
case TYPE_CEC_BUTTON: case TYPE_CEC_BUTTON:
return "cec-button"; return "cec-button";
default: default:
@ -43,6 +45,8 @@ InputType InputConfig::stringToInputType(const std::string& type)
return TYPE_BUTTON; return TYPE_BUTTON;
if (type == "key") if (type == "key")
return TYPE_KEY; return TYPE_KEY;
if (type == "touch-button")
return TYPE_TOUCH;
if (type == "cec-button") if (type == "cec-button")
return TYPE_CEC_BUTTON; return TYPE_CEC_BUTTON;
return TYPE_COUNT; return TYPE_COUNT;

View file

@ -17,8 +17,8 @@
#include <vector> #include <vector>
#define DEVICE_KEYBOARD -1 #define DEVICE_KEYBOARD -1
#define DEVICE_TOUCH -2 #define DEVICE_CEC -2
#define DEVICE_CEC -3 #define DEVICE_TOUCH -3
enum InputType { enum InputType {
TYPE_AXIS, TYPE_AXIS,
@ -83,6 +83,10 @@ public:
stream << "Key " << SDL_GetKeyName((SDL_Keycode)id); stream << "Key " << SDL_GetKeyName((SDL_Keycode)id);
break; break;
} }
case TYPE_TOUCH: {
stream << "Button " << id;
break;
}
case TYPE_CEC_BUTTON: { case TYPE_CEC_BUTTON: {
stream << "CEC-Button " << getCECButtonName(id); stream << "CEC-Button " << getCECButtonName(id);
break; break;