Gainput  v1.0.0
GainputButtonStickGesture.h
1 
2 #ifndef GAINPUTBUTTONSTICKGESTURE_H_
3 #define GAINPUTBUTTONSTICKGESTURE_H_
4 
5 #ifdef GAINPUT_ENABLE_BUTTON_STICK_GESTURE
6 
7 namespace gainput
8 {
9 
11 enum ButtonStickAction
12 {
13  ButtonStickAxis
14 };
15 
16 
17 class GAINPUT_LIBEXPORT ButtonStickGesture : public InputGesture
18 {
19 public:
21  ButtonStickGesture(InputManager& manager, DeviceId device, unsigned index, DeviceVariant variant);
23  ~ButtonStickGesture();
24 
26  void Initialize(DeviceId negativeAxisDevice, DeviceButtonId negativeAxis,
27  DeviceId positiveAxisDevice, DeviceButtonId positiveAxis);
28 
29  bool IsValidButtonId(DeviceButtonId deviceButton) const { return deviceButton == ButtonStickAxis; }
30 
31  ButtonType GetButtonType(DeviceButtonId deviceButton) const { GAINPUT_UNUSED(deviceButton); GAINPUT_ASSERT(IsValidButtonId(deviceButton)); return BT_FLOAT; }
32 
33 protected:
34  void InternalUpdate(InputDeltaState* delta);
35 
36 private:
37  DeviceButtonSpec negativeAxis_;
38  DeviceButtonSpec positiveAxis_;
39 
40 };
41 
42 }
43 
44 #endif
45 
46 #endif
47 
ButtonType
Type of an input device button.
Definition: GainputInputDevice.h:10
unsigned int DeviceId
ID of an input device.
Definition: gainput.h:107
A floating-point value button, between -1.0f and 1.0f or 0.0f and 1.0f.
Definition: GainputInputDevice.h:13
unsigned int DeviceButtonId
ID of a specific button unique to an input device.
Definition: gainput.h:109
Contains all Gainput related classes, types, and functions.
Definition: gainput.h:103