-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheventHandler.h
42 lines (28 loc) · 908 Bytes
/
eventHandler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// Created by jovasa on 15.1.2024.
//
#ifndef VISUALIZER_EVENTHANDLER_H
#define VISUALIZER_EVENTHANDLER_H
#include <cstdint>
#include <SFML/Window/Event.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
#include "config.h"
class EventHandler {
bool shift_pressed = false;
bool ctrl_pressed = false;
bool alt_pressed = false;
uint64_t last_click = 0;
uint64_t last_click2 = 0;
uint32_t width;
uint32_t height;
uint32_t screen_width;
uint32_t screen_height;
void *control_socket = nullptr;
public:
EventHandler(uint32_t width, uint32_t height, void* socket);
EventHandler(const EventHandler &) = delete;
EventHandler &operator=(const EventHandler &) = delete;
bool handle(sf::Event &event, config &cfg, sf::RenderWindow &window);
void toggleFullscreen(config &cfg, sf::RenderWindow &window) const;
};
#endif //VISUALIZER_EVENTHANDLER_H