From a3e57f40081a051313d117a8d06986fdb3b66138 Mon Sep 17 00:00:00 2001 From: "Chris \"koying\" Browet" Date: Wed, 9 Dec 2015 11:22:05 +0100 Subject: FIX: [droid;input] regression after stylus fix --- xbmc/android/activity/EventLoop.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xbmc/android/activity/EventLoop.cpp b/xbmc/android/activity/EventLoop.cpp index c78f36216d..e96f42fa03 100644 --- a/xbmc/android/activity/EventLoop.cpp +++ b/xbmc/android/activity/EventLoop.cpp @@ -24,6 +24,8 @@ #include +#define IS_FROM_SOURCE(v, s) ((v & s) == s) + CEventLoop::CEventLoop(android_app* application) : m_enabled(false), m_application(application), @@ -143,7 +145,7 @@ int32_t CEventLoop::processInput(AInputEvent* event) switch(type) { case AINPUT_EVENT_TYPE_KEY: - if (source & AINPUT_SOURCE_GAMEPAD || source & AINPUT_SOURCE_JOYSTICK) + if (IS_FROM_SOURCE(source, AINPUT_SOURCE_GAMEPAD) || IS_FROM_SOURCE(source, AINPUT_SOURCE_JOYSTICK)) { if (m_inputHandler->onJoyStickKeyEvent(event)) return true; @@ -151,11 +153,11 @@ int32_t CEventLoop::processInput(AInputEvent* event) rtn = m_inputHandler->onKeyboardEvent(event); break; case AINPUT_EVENT_TYPE_MOTION: - if (source & AINPUT_SOURCE_TOUCHSCREEN) + if (IS_FROM_SOURCE(source, AINPUT_SOURCE_TOUCHSCREEN)) rtn = m_inputHandler->onTouchEvent(event); - else if (source & AINPUT_SOURCE_MOUSE) + else if (IS_FROM_SOURCE(source, AINPUT_SOURCE_MOUSE)) rtn = m_inputHandler->onMouseEvent(event); - else if (source & (AINPUT_SOURCE_GAMEPAD | AINPUT_SOURCE_JOYSTICK)) + else if (IS_FROM_SOURCE(source, AINPUT_SOURCE_GAMEPAD) || IS_FROM_SOURCE(source, AINPUT_SOURCE_JOYSTICK)) rtn = m_inputHandler->onJoyStickMotionEvent(event); break; } -- cgit v1.2.3