Gainput
v1.0.0
lib
include
gainput
gestures
GainputTapGesture.h
1
2
#ifndef GAINPUTTAPGESTURE_H_
3
#define GAINPUTTAPGESTURE_H_
4
5
#ifdef GAINPUT_ENABLE_TAP_GESTURE
6
7
namespace
gainput
8
{
9
11
enum
TapAction
12
{
13
TapTriggered
14
};
15
17
30
class
GAINPUT_LIBEXPORT
TapGesture
:
public
InputGesture
31
{
32
public
:
34
TapGesture
(
InputManager
& manager,
DeviceId
device,
unsigned
index,
DeviceVariant
variant);
36
~
TapGesture
();
37
39
44
void
Initialize(
DeviceId
actionButtonDevice,
DeviceButtonId
actionButton, uint64_t timeSpan = 500);
45
46
bool
IsValidButtonId
(
DeviceButtonId
deviceButton)
const
{
return
deviceButton ==
TapTriggered
; }
47
48
ButtonType
GetButtonType
(
DeviceButtonId
deviceButton)
const
{ GAINPUT_UNUSED(deviceButton); GAINPUT_ASSERT(IsValidButtonId(deviceButton));
return
BT_BOOL
; }
49
50
protected
:
51
void
InternalUpdate(
InputDeltaState
* delta);
52
53
private
:
54
DeviceButtonSpec
actionButton_;
55
56
uint64_t timeSpan_;
57
uint64_t firstDownTime_;
58
59
};
60
61
}
62
63
#endif
64
65
#endif
66
gainput::InputManager
Manages all input devices and some other helpful stuff.
Definition:
GainputInputManager.h:24
gainput::BT_BOOL
A boolean value button, either down (true) or up (false).
Definition:
GainputInputDevice.h:12
gainput::ButtonType
ButtonType
Type of an input device button.
Definition:
GainputInputDevice.h:10
gainput::TapGesture::GetButtonType
ButtonType GetButtonType(DeviceButtonId deviceButton) const
Returns the type of the given button.
Definition:
GainputTapGesture.h:48
gainput::TapAction
TapAction
Buttons provided by the TapGesture.
Definition:
GainputTapGesture.h:11
gainput::InputDeltaState
Stores a list of input state changes.
Definition:
GainputInputDeltaState.h:9
gainput::DeviceButtonSpec
Describes a device button on a specific device.
Definition:
gainput.h:112
gainput::DeviceId
unsigned int DeviceId
ID of an input device.
Definition:
gainput.h:107
gainput::InputDevice::DeviceVariant
DeviceVariant
Variant of an input device type.
Definition:
GainputInputDevice.h:51
gainput::InputGesture
Base class for all input gestures.
Definition:
GainputGestures.h:41
gainput::TapGesture
A tap-to-trigger gesture.
Definition:
GainputTapGesture.h:30
gainput::TapGesture::IsValidButtonId
bool IsValidButtonId(DeviceButtonId deviceButton) const
Returns if the given button is valid for this device.
Definition:
GainputTapGesture.h:46
gainput::DeviceButtonId
unsigned int DeviceButtonId
ID of a specific button unique to an input device.
Definition:
gainput.h:109
gainput
Contains all Gainput related classes, types, and functions.
Definition:
gainput.h:103
gainput::TapTriggered
The button that is triggered by tapping.
Definition:
GainputTapGesture.h:13
Generated on Wed Sep 6 2017 20:47:59 for Gainput by
1.8.13