diff options
Diffstat (limited to 'libs/input/Input.cpp')
-rw-r--r-- | libs/input/Input.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/libs/input/Input.cpp b/libs/input/Input.cpp index 13ca9ecd35..155cb040fb 100644 --- a/libs/input/Input.cpp +++ b/libs/input/Input.cpp @@ -64,9 +64,10 @@ float transformAngle(const ui::Transform& transform, float angleRadians) { } bool shouldDisregardTransformation(uint32_t source) { - // Do not apply any transformations to axes from joysticks or touchpads. + // Do not apply any transformations to axes from joysticks, touchpads, or relative mice. return isFromSource(source, AINPUT_SOURCE_CLASS_JOYSTICK) || - isFromSource(source, AINPUT_SOURCE_CLASS_POSITION); + isFromSource(source, AINPUT_SOURCE_CLASS_POSITION) || + isFromSource(source, AINPUT_SOURCE_MOUSE_RELATIVE); } bool shouldDisregardOffset(uint32_t source) { @@ -89,6 +90,25 @@ const char* motionClassificationToString(MotionClassification classification) { } } +const char* motionToolTypeToString(int32_t toolType) { + switch (toolType) { + case AMOTION_EVENT_TOOL_TYPE_UNKNOWN: + return "UNKNOWN"; + case AMOTION_EVENT_TOOL_TYPE_FINGER: + return "FINGER"; + case AMOTION_EVENT_TOOL_TYPE_STYLUS: + return "STYLUS"; + case AMOTION_EVENT_TOOL_TYPE_MOUSE: + return "MOUSE"; + case AMOTION_EVENT_TOOL_TYPE_ERASER: + return "ERASER"; + case AMOTION_EVENT_TOOL_TYPE_PALM: + return "PALM"; + default: + return "INVALID"; + } +} + // --- IdGenerator --- IdGenerator::IdGenerator(Source source) : mSource(source) {} |