Gainput  v1.0.0
GainputInputDeviceTouch.h
1 
2 #ifndef GAINPUTINPUTDEVICETOUCH_H_
3 #define GAINPUTINPUTDEVICETOUCH_H_
4 
5 namespace gainput
6 {
7 
10 {
11  Touch0Down,
12  Touch0X,
13  Touch0Y,
14  Touch0Pressure,
15  Touch1Down,
16  Touch1X,
17  Touch1Y,
18  Touch1Pressure,
19  Touch2Down,
20  Touch2X,
21  Touch2Y,
22  Touch2Pressure,
23  Touch3Down,
24  Touch3X,
25  Touch3Y,
26  Touch3Pressure,
27  Touch4Down,
28  Touch4X,
29  Touch4Y,
30  Touch4Pressure,
31  Touch5Down,
32  Touch5X,
33  Touch5Y,
34  Touch5Pressure,
35  Touch6Down,
36  Touch6X,
37  Touch6Y,
38  Touch6Pressure,
39  Touch7Down,
40  Touch7X,
41  Touch7Y,
42  Touch7Pressure,
43  TouchCount_
44 };
45 
46 
47 
48 class InputDeviceTouchImpl;
49 
51 
63 class GAINPUT_LIBEXPORT InputDeviceTouch : public InputDevice
64 {
65 public:
67 
73  InputDeviceTouch(InputManager& manager, DeviceId device, unsigned index, DeviceVariant variant);
76 
78  DeviceType GetType() const { return DT_TOUCH; }
79  DeviceVariant GetVariant() const;
80  const char* GetTypeName() const { return "touch"; }
81  bool IsValidButtonId(DeviceButtonId deviceButton) const;
82 
83  size_t GetAnyButtonDown(DeviceButtonSpec* outButtons, size_t maxButtonCount) const;
84 
85  size_t GetButtonName(DeviceButtonId deviceButton, char* buffer, size_t bufferLength) const;
86  ButtonType GetButtonType(DeviceButtonId deviceButton) const;
87  DeviceButtonId GetButtonByName(const char* name) const;
88 
89  InputState* GetNextInputState();
90 
92  InputDeviceTouchImpl* GetPimpl() { return impl_; }
93 
94 protected:
95  void InternalUpdate(InputDeltaState* delta);
96 
97  DeviceState InternalGetState() const;
98 
99 private:
100  InputDeviceTouchImpl* impl_;
101 
102 };
103 
104 }
105 
106 #endif
107 
Manages all input devices and some other helpful stuff.
Definition: GainputInputManager.h:24
ButtonType
Type of an input device button.
Definition: GainputInputDevice.h:10
A touch input device.
Definition: GainputInputDeviceTouch.h:63
Stores a list of input state changes.
Definition: GainputInputDeltaState.h:9
Describes a device button on a specific device.
Definition: gainput.h:112
unsigned int DeviceId
ID of an input device.
Definition: gainput.h:107
DeviceState
State of an input device.
Definition: GainputInputDevice.h:59
InputDeviceTouchImpl * GetPimpl()
Returns the platform-specific implementation of this device.
Definition: GainputInputDeviceTouch.h:92
DeviceVariant
Variant of an input device type.
Definition: GainputInputDevice.h:51
DeviceType
Type of an input device.
Definition: GainputInputDevice.h:37
Interface for anything that provides device inputs.
Definition: GainputInputDevice.h:33
DeviceType GetType() const
Returns DT_TOUCH.
Definition: GainputInputDeviceTouch.h:78
const char * GetTypeName() const
Returns the device type's name.
Definition: GainputInputDeviceTouch.h:80
unsigned int DeviceButtonId
ID of a specific button unique to an input device.
Definition: gainput.h:109
State of an input device.
Definition: GainputInputState.h:9
Contains all Gainput related classes, types, and functions.
Definition: gainput.h:103
TouchButton
All valid device inputs for InputDeviceTouch.
Definition: GainputInputDeviceTouch.h:9