123456789101112131415161718192021222324252627282930313233 |
- #pragma once
- #include <SFML/Window.hpp>
- #include <cstring>
- class Input
- {
- public:
- enum Type
- {
- RealTime = 1,
- Pressed = 1 << 1,
- Released = 1 << 2
- };
- Input() = delete;
- Input(const Input& other);
- Input& operator=(const Input& other);
- Input(const sf::Keyboard::Key& key, int type=Type::RealTime|Type::Pressed);
- Input(const sf::Mouse::Button& button, int type=Type::RealTime|Type::Pressed);
- Input(const int joystickButton, int type=Type::RealTime|Type::Pressed);
- Input(const sf::Joystick::Axis& axis, bool positive);
-
- float test() const;
-
- bool operator==(const sf::Event& event) const;
- bool operator==(const Input& other) const;
- private:
- template<typename> friend class InputTarget;
- sf::Event _event;
- int _type;
- bool _positive;
- };
|