diff options
author | Chris "koying" Browet <cbro@semperpax.com> | 2015-12-09 11:22:05 +0100 |
---|---|---|
committer | Chris "Koying" Browet <cbro@semperpax.com> | 2015-12-11 18:39:37 +0100 |
commit | a3e57f40081a051313d117a8d06986fdb3b66138 (patch) | |
tree | d68264f28c5de3dd6d14b56876d26c9894cfcbe0 | |
parent | 2a2ee7ce4e7c6be67766629c3fce452f1eb51e31 (diff) |
FIX: [droid;input] regression after stylus fix
-rw-r--r-- | xbmc/android/activity/EventLoop.cpp | 10 |
1 files 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 <dlfcn.h> +#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; } |