3 * Copyright (C) 2012-2013 Team XBMC
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
34 // internal helper values
38 } APP_InputDeviceAxis
;
42 APP_InputDeviceAxis x_hat
;
43 APP_InputDeviceAxis y_hat
;
44 APP_InputDeviceAxis x_axis
;
45 APP_InputDeviceAxis y_axis
;
46 APP_InputDeviceAxis z_axis
;
47 APP_InputDeviceAxis rz_axis
;
48 } APP_InputDeviceAxes
;
50 class CAndroidJoyStick
56 bool onJoyStickKeyEvent(AInputEvent
* event
);
57 bool onJoyStickMotionEvent(AInputEvent
* event
);
60 void ProcessMotionEvents(AInputEvent
*event
, size_t pointer_index
,
61 int32_t device
, APP_InputDeviceAxes
*axes
);
62 bool ProcessHat( AInputEvent
*event
, size_t pointer_index
,
63 APP_InputDeviceAxis
&hat
, int device
, int android_axis
);
64 bool ProcessAxis(AInputEvent
*event
, size_t pointer_index
,
65 APP_InputDeviceAxis
&axis
, int device
, int keymap_axis
, int android_axis
);
67 void XBMC_JoyAxis(uint8_t device
, uint8_t axis
, float value
);
68 void XBMC_JoyHat(uint8_t device
, uint8_t value
);
69 void XBMC_JoyButton(uint8_t device
, uint8_t button
, uint32_t holdtime
, bool up
);
71 uint8_t m_prev_device
;
72 uint8_t m_prev_button
;
73 uint32_t m_prev_holdtime
;
74 std::vector
<APP_InputDeviceAxes
*> m_input_devices
;