Adjusted workflow.
This commit is contained in:
55
include/ehs/io/hid/ButtonState.h
Normal file
55
include/ehs/io/hid/ButtonState.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#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;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user