67 bool operator==(
const Key&)
const =
default;
A key on the keyboard: one without a character, e.g.
static std::optional< Key > fromString(std::string_view name)
The key whose toString() is name, or std::nullopt if there's none.
std::string toString() const
Used to display the key, e.g.
Key(std::string character)
The key that types character, which has to be exactly one UTF-8 character, e.g.
bool down() const
Whether the key is down, regardless of Shift, Ctrl and Alt.
Key(char character)
The key that types character, e.g.
Key(key::KeyType)
A key without a character, e.g. jngl::key::F1, or key::Ctrl for either of the two.
bool pressed() const
Whether the key has been pressed since the next to last call to updateInput(), regardless of Shift,...
std::vector< Key > keysPressed()
The keys that have been pressed since the next to last call to updateInput(), in the order they went ...