2 * Copyright (C) 2012-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
9 #include "AndroidJoyStick.h"
11 #include "platform/android/activity/XBMCApp.h"
13 #include <android/input.h>
15 bool CAndroidJoyStick::onJoyStickEvent(AInputEvent
* event
)
17 int32_t source
= AInputEvent_getSource(event
);
19 // only handle input events from a gamepad or joystick
20 if ((source
& (AINPUT_SOURCE_GAMEPAD
| AINPUT_SOURCE_JOYSTICK
)) != 0)
21 return CXBMCApp::Get().onInputDeviceEvent(event
);
23 CXBMCApp::android_printf("CAndroidJoyStick::onJoyStickEvent(type = %d, keycode = %d, source = %d): ignoring non-joystick input event",
24 AInputEvent_getType(event
), AKeyEvent_getKeyCode(event
), source
);