mirror of
https://github.com/Lorenzooone/cc3dsfs.git
synced 2026-09-07 16:15:18 -05:00
Implement RPi basic version-special code
This commit is contained in:
28
include/ExtraButtons.hpp
Executable file
28
include/ExtraButtons.hpp
Executable file
@@ -0,0 +1,28 @@
|
||||
#ifndef __EXTRABUTTONS_HPP
|
||||
#define __EXTRABUTTONS_HPP
|
||||
|
||||
#include <chrono>
|
||||
#include "sfml_gfx_structs.hpp"
|
||||
|
||||
class ExtraButton {
|
||||
public:
|
||||
void initialize(int pi_value, int id, sf::Keyboard::Key corresponding_key, bool is_power, float first_re_press_time, float later_re_press_time);
|
||||
int get_pi_value();
|
||||
void poll(std::queue<SFEvent> &events_queue);
|
||||
private:
|
||||
bool initialized = false;
|
||||
int id;
|
||||
sf::Keyboard::Key corresponding_key;
|
||||
bool is_power;
|
||||
int pi_value;
|
||||
bool started;
|
||||
bool after_first;
|
||||
float first_re_press_time;
|
||||
float later_re_press_time;
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> last_press_time;
|
||||
bool is_time_valid;
|
||||
|
||||
bool is_pressed();
|
||||
bool is_valid();
|
||||
};
|
||||
#endif
|
||||
Reference in New Issue
Block a user