9#include <SFML/Window/Keyboard.hpp>
10#include <SFML/Window/Mouse.hpp>
14namespace Imago::Engine
18 enum class GamepadButton : uint8_t
25 LeftStick, RightStick,
26 LeftShoulder, RightShoulder,
27 DPadLeft, DPadRight, DPadUp, DPadDown,
31 enum class GamepadAxis : uint8_t
49 struct KeySource { sf::Keyboard::Scancode scancode; };
68 constexpr bool operator==(
const KeySource& a,
const KeySource& b) {
return a.scancode == b.scancode; }
69 constexpr bool operator!=(
const KeySource& a,
const KeySource& b) {
return !(a==b); }
71 constexpr bool operator==(
const MouseButtonSource& a,
const MouseButtonSource& b) {
return a.button == b.button; }
85 using InputSource = std::variant<KeySource, MouseButtonSource, GamepadButtonSource, GamepadAxisSource>;
A gamepad axis motion that drives an action. Reads as a strength rescaled to a dead zone and scaled t...
Definition InputSource.hpp:63
A keybaord key that drives an action. Reads as 0 or 1. (pressed or not pressed).
Definition InputSource.hpp:49