1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
3 | #pragma once |
4 | |
5 | #include "BsCorePrerequisites.h" |
6 | #include "Input/BsInputFwd.h" |
7 | |
8 | namespace bs |
9 | { |
10 | /** Infomation about an analog axis that's part of a gamepad. */ |
11 | struct AxisInfo |
12 | { |
13 | INT32 axisIdx; |
14 | INT32 min; |
15 | INT32 max; |
16 | }; |
17 | |
18 | /** Information about a gamepad. */ |
19 | struct GamepadInfo |
20 | { |
21 | UINT32 id; |
22 | UINT32 eventHandlerIdx; |
23 | String name; |
24 | |
25 | UnorderedMap<INT32, ButtonCode> buttonMap; |
26 | UnorderedMap<INT32, AxisInfo> axisMap; |
27 | }; |
28 | |
29 | /** |
30 | * Data specific to Linux implementation of the input system. Can be passed to platform specific implementations of |
31 | * the individual device types. |
32 | */ |
33 | struct InputPrivateData |
34 | { |
35 | Vector<GamepadInfo> gamepadInfos; |
36 | }; |
37 | |
38 | /** Data about relative pointer / scroll wheel movement. */ |
39 | struct LinuxMouseMotionEvent |
40 | { |
41 | double deltaX; /**< Relative pointer movement in X direction. */ |
42 | double deltaY; /**< Relative pointer movement in Y direction. */ |
43 | double deltaZ; /**< Relative vertical scroll amount. */ |
44 | }; |
45 | |
46 | /** Data about a single button press or release. */ |
47 | struct LinuxButtonEvent |
48 | { |
49 | UINT64 timestamp; |
50 | ButtonCode button; |
51 | bool pressed; |
52 | }; |
53 | |
54 | #define BUFFER_SIZE_GAMEPAD 64 |
55 | } |
56 | |
57 | |