Gainput
v1.0.0
lib
include
gainput
gestures
GainputDoubleClickGesture.h
1
2
#ifndef GAINPUTDOUBLECLICKGESTURE_H_
3
#define GAINPUTDOUBLECLICKGESTURE_H_
4
5
#ifdef GAINPUT_ENABLE_DOUBLE_CLICK_GESTURE
6
7
namespace
gainput
8
{
9
11
enum
DoubleClickAction
12
{
13
DoubleClickTriggered
14
};
15
17
32
class
GAINPUT_LIBEXPORT
DoubleClickGesture
:
public
InputGesture
33
{
34
public
:
36
DoubleClickGesture
(
InputManager
& manager,
DeviceId
device,
unsigned
index,
DeviceVariant
variant);
38
~
DoubleClickGesture
();
39
41
46
void
Initialize(
DeviceId
actionButtonDevice,
DeviceButtonId
actionButton, uint64_t timeSpan = 300);
48
59
void
Initialize(
DeviceId
actionButtonDevice,
DeviceButtonId
actionButton,
60
DeviceId
xAxisDevice,
DeviceButtonId
xAxis,
float
xTolerance,
61
DeviceId
yAxisDevice,
DeviceButtonId
yAxis,
float
yTolerance,
62
uint64_t timeSpan = 300);
63
65
68
void
SetClicksTargetCount
(
unsigned
count) { clicksTargetCount_ = count; }
69
70
bool
IsValidButtonId
(
DeviceButtonId
deviceButton)
const
{
return
deviceButton ==
DoubleClickTriggered
; }
71
72
ButtonType
GetButtonType
(
DeviceButtonId
deviceButton)
const
{ GAINPUT_UNUSED(deviceButton); GAINPUT_ASSERT(IsValidButtonId(deviceButton));
return
BT_BOOL
; }
73
74
protected
:
75
void
InternalUpdate(
InputDeltaState
* delta);
76
77
private
:
78
DeviceButtonSpec
actionButton_;
79
DeviceButtonSpec
xAxis_;
80
float
xTolerance_;
81
DeviceButtonSpec
yAxis_;
82
float
yTolerance_;
83
84
uint64_t timeSpan_;
85
uint64_t firstClickTime_;
86
87
float
firstClickX_;
88
float
firstClickY_;
89
90
unsigned
clicksRegistered_;
91
unsigned
clicksTargetCount_;
92
};
93
94
}
95
96
#endif
97
98
#endif
99
gainput::DoubleClickGesture::SetClicksTargetCount
void SetClicksTargetCount(unsigned count)
Sets the number of clicks to trigger an action.
Definition:
GainputDoubleClickGesture.h:68
gainput::DoubleClickAction
DoubleClickAction
Buttons provided by the DoubleClickGesture.
Definition:
GainputDoubleClickGesture.h:11
gainput::DoubleClickGesture::IsValidButtonId
bool IsValidButtonId(DeviceButtonId deviceButton) const
Returns if the given button is valid for this device.
Definition:
GainputDoubleClickGesture.h:70
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::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::DoubleClickGesture
A double-click gesture.
Definition:
GainputDoubleClickGesture.h:32
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::DoubleClickGesture::GetButtonType
ButtonType GetButtonType(DeviceButtonId deviceButton) const
Returns the type of the given button.
Definition:
GainputDoubleClickGesture.h:72
gainput::DoubleClickTriggered
The button triggered by double-clicking.
Definition:
GainputDoubleClickGesture.h:13
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
Generated on Wed Sep 6 2017 20:47:59 for Gainput by
1.8.13