Files
kaizen/lib/include/gainput/gestures/GainputButtonStickGesture.h
Simone 4e42229bdd Squashed 'external/gainput/' content from commit 2be0a50
git-subtree-dir: external/gainput
git-subtree-split: 2be0a50089eafcc6fccb66142180082e48f27f4c
2024-01-22 08:51:55 +01:00

48 lines
1.1 KiB
C++

#ifndef GAINPUTBUTTONSTICKGESTURE_H_
#define GAINPUTBUTTONSTICKGESTURE_H_
#ifdef GAINPUT_ENABLE_BUTTON_STICK_GESTURE
namespace gainput
{
/// Buttons provided by the ButtonStickGesture.
enum ButtonStickAction
{
ButtonStickAxis
};
class GAINPUT_LIBEXPORT ButtonStickGesture : public InputGesture
{
public:
/// Initializes the gesture.
ButtonStickGesture(InputManager& manager, DeviceId device, unsigned index, DeviceVariant variant);
/// Uninitializes the gesture.
~ButtonStickGesture();
/// Sets up the gesture for operation with the given axes and buttons.
void Initialize(DeviceId negativeAxisDevice, DeviceButtonId negativeAxis,
DeviceId positiveAxisDevice, DeviceButtonId positiveAxis);
bool IsValidButtonId(DeviceButtonId deviceButton) const { return deviceButton == ButtonStickAxis; }
ButtonType GetButtonType(DeviceButtonId deviceButton) const { GAINPUT_UNUSED(deviceButton); GAINPUT_ASSERT(IsValidButtonId(deviceButton)); return BT_FLOAT; }
protected:
void InternalUpdate(InputDeltaState* delta);
private:
DeviceButtonSpec negativeAxis_;
DeviceButtonSpec positiveAxis_;
};
}
#endif
#endif