cangine
Loading...
Searching...
No Matches
key.hpp
Go to the documentation of this file.
1#pragma once
2// remapping keys for better accessibility.
3
4namespace cangine {
11 enum class Key {
12 Unknown = -1,
13
14 // charactes
15 A, B, C, D, E, F, G, H, I, J, K, L, M,
16 N, O, P, Q, R, S, T, U, V, W, X, Y, Z,
17
18 // numbers
20
21 // function
22 F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
23
24 // direction
25 Up, Down, Left, Right,
26
27 // control keys
29
30 // shift / ctrl / alt
33
34 // numpad
37
38 // other
40 };
41
43 enum class KeyEventType {
44 Down,
45 Up,
46 Repeat,
47 Unknown
48 };
49
55
61 Key translateGLFWKey(int key);
67 KeyEventType getKeyEventType(int glfwKeyEvent);
68}
Definition audiomanager.cpp:4
KeyEventType
The kind of keyboard event that occurred.
Definition key.hpp:43
@ Repeat
Key is held and generating auto-repeat events.
Key
Platform-independent keyboard key identifiers.
Definition key.hpp:11
@ Unknown
Unrecognized or unmapped key.
Key translateGLFWKey(int key)
Translates a raw GLFW key code into a Key.
Definition key.cpp:9
KeyEventType getKeyEventType(int glfwKeyEvent)
Translates a raw GLFW key action into a KeyEventType.
Definition key.cpp:133
A keyboard event: which key and what happened to it.
Definition key.hpp:51
Key key
The key involved in the event.
Definition key.hpp:52
KeyEventType type
The kind of event.
Definition key.hpp:53