-
Notifications
You must be signed in to change notification settings - Fork 1
/
InputManager.hpp
58 lines (47 loc) · 1.08 KB
/
InputManager.hpp
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef INPUTMANAGER_HPP
#define INPUTMANAGER_HPP
#include <iostream>
#include <SFML/Window.hpp>
class InputManager {
private:
bool isFocused;
bool isLocked;
std::string inputString;
sf::Window *window;
public:
enum JoyButton{
A,
B,
X,
Y,
LB,
RB,
Select,
Start,
Meta,
};
InputManager();
InputManager(sf::Window *window);
void setWindow(sf::Window *window);
bool isGuiLocked();
void lockToGui(bool yes);
void setFocus(bool yes);
bool isKeyDown(sf::Keyboard::Key key);
bool isMouseDown(sf::Mouse::Button button);
sf::Vector2i getMousePos();
void setMousePos(sf::Vector2i pos);
bool isGuiKeyDown(sf::Keyboard::Key key);
bool isGuiMouseDown(sf::Mouse::Button button);
sf::Vector2i getGuiMousePos();
void setGuiMousePos(sf::Vector2i pos);
bool isJoystickConnected();
bool isJoystickButtonDown(JoyButton b);
sf::Vector2f getLeftAnalog();
sf::Vector2f getRightAnalog();
sf::Vector2i getDpad();
float getLeftTrigger();
float getRightTrigger();
void addInput(std::string input);
std::string getString();
};
#endif