wren
Vulkan-based game engine
Loading...
Searching...
No Matches
input.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <unordered_map>
4
5#include "event.hpp"
6#include "keycode.hpp"
7
8namespace wren {
9
10class Input {
11 public:
12 void initialize(event::Dispatcher& dispatcher);
13
14 auto is_pressed(KeyCode key) const -> bool;
15 auto is_pressed_down(KeyCode key) const -> bool;
16
17 auto end_frame() { pressed_down_.clear(); }
18
19 private:
20 std::unordered_map<KeyCode, bool> pressed_;
21 std::unordered_map<KeyCode, bool> pressed_down_;
22};
23
24} // namespace wren
Definition input.hpp:10
std::unordered_map< KeyCode, bool > pressed_down_
Definition input.hpp:21
auto is_pressed(KeyCode key) const -> bool
Definition input.cpp:12
std::unordered_map< KeyCode, bool > pressed_
Definition input.hpp:20
auto end_frame()
Definition input.hpp:17
auto is_pressed_down(KeyCode key) const -> bool
Definition input.cpp:16
void initialize(event::Dispatcher &dispatcher)
Definition input.cpp:5
Definition event.hpp:75
Definition editor_scene.hpp:5
KeyCode
Definition keycode.hpp:7