Skip to content

Commit 46c2393

Browse files
committed
gameactivity: don't discard stylus touchscreen inputs
Modify default_motion_filter to use bitwise AND (&) instead of equality (==) when checking SOURCE_TOUCHSCREEN. This ensures stylus inputs (which combine touchscreen and stylus flags) are not discarded, while still filtering non-touch events. I noticed touch inputs weren't working on my Galaxy S9 tab device which includes a stylus. Changelog-Fixed: Fix touch inputs on tablets with a stylus Signed-off-by: William Casarin <jb55@jb55.com>
1 parent 8e80d8a commit 46c2393

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static bool default_key_filter(const GameActivityKeyEvent* event) {
264264

265265
static bool default_motion_filter(const GameActivityMotionEvent* event) {
266266
// Ignore any non-touch events.
267-
return event->source == SOURCE_TOUCHSCREEN;
267+
return event->source & SOURCE_TOUCHSCREEN;
268268
}
269269

270270
// --------------------------------------------------------------------

0 commit comments

Comments
 (0)