EHS/include/ehs/io/hid/ButtonState.h
Karutoh bcd71cf2b5
All checks were successful
Build & Release / Windows-AMD64-Build (push) Successful in 1m8s
Build & Release / Linux-AMD64-Build (push) Successful in 1m30s
Build & Release / Linux-AARCH64-Build (push) Successful in 3m21s
Adjusted workflow.
2024-02-05 22:25:30 -08:00

55 lines
847 B
C++

#pragma once
#include "ehs/EHS.h"
#include "Button.h"
namespace ehs
{
enum class State
{
JUST_RELEASED,
RELEASED,
PRESSED,
TOUCHED
};
class ButtonState
{
private:
Button button;
State state;
bool pressed;
float threshold;
public:
ButtonState();
ButtonState(const Button& button, const State state);
ButtonState(const ButtonState& bs);
ButtonState& operator=(const ButtonState& bs);
bool operator==(const Button& other) const;
bool operator!=(const Button& other) const;
bool operator==(const State otherState) const;
bool operator!=(const State otherState) const;
Button GetButton() const;
void SetState(State newState);
State GetState() const;
void SetPressed(bool value);
bool IsPressed() const;
void SetThreshold(const float newThreshold);
float GetThreshold() const;
};
}