Gainput  v1.0.0
GainputSimultaneouslyDownGesture.h
1 
2 #ifndef GAINPUTSIMULTANEOUSLYDOWNGESTURE_H_
3 #define GAINPUTSIMULTANEOUSLYDOWNGESTURE_H_
4 
5 #ifdef GAINPUT_ENABLE_SIMULTANEOUSLY_DOWN_GESTURE
6 
7 namespace gainput
8 {
9 
12 {
14 };
15 
17 
31 class GAINPUT_LIBEXPORT SimultaneouslyDownGesture : public InputGesture
32 {
33 public:
35  SimultaneouslyDownGesture(InputManager& manager, DeviceId device, unsigned index, DeviceVariant variant);
38 
40 
44  void AddButton(DeviceId device, DeviceButtonId button);
45 
47  void ClearButtons();
48 
49  bool IsValidButtonId(DeviceButtonId deviceButton) const { return deviceButton == SimultaneouslyDownTriggered; }
50 
51  ButtonType GetButtonType(DeviceButtonId deviceButton) const { GAINPUT_UNUSED(deviceButton); GAINPUT_ASSERT(IsValidButtonId(deviceButton)); return BT_BOOL; }
52 
53 protected:
54  void InternalUpdate(InputDeltaState* delta);
55 
56 private:
57  Array<DeviceButtonSpec> buttons_;
58 
59 };
60 
61 }
62 
63 #endif
64 
65 #endif
66 
A std::vector-like data container for POD-types.
Definition: GainputContainers.h:96
Manages all input devices and some other helpful stuff.
Definition: GainputInputManager.h:24
A boolean value button, either down (true) or up (false).
Definition: GainputInputDevice.h:12
ButtonType
Type of an input device button.
Definition: GainputInputDevice.h:10
bool IsValidButtonId(DeviceButtonId deviceButton) const
Returns if the given button is valid for this device.
Definition: GainputSimultaneouslyDownGesture.h:49
Stores a list of input state changes.
Definition: GainputInputDeltaState.h:9
unsigned int DeviceId
ID of an input device.
Definition: gainput.h:107
DeviceVariant
Variant of an input device type.
Definition: GainputInputDevice.h:51
SimultaneouslyDownAction
Buttons provided by the SimultaneouslyDownGesture.
Definition: GainputSimultaneouslyDownGesture.h:11
Base class for all input gestures.
Definition: GainputGestures.h:41
A gesture that tracks if a number of buttons is down simultaneously.
Definition: GainputSimultaneouslyDownGesture.h:31
ButtonType GetButtonType(DeviceButtonId deviceButton) const
Returns the type of the given button.
Definition: GainputSimultaneouslyDownGesture.h:51
The button triggered by double-clicking.
Definition: GainputSimultaneouslyDownGesture.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