OWL - Open Windowing Library
The Key
enums are a part of the keyboard
class - they are used by the isKeyPressed()
function to check whether or not is the key behind a certain enum pressed, and are used in the KeyData
structure, as the keyEnum
value. The structure is returned by the getKeyData()
function.
These are all the keys in it:
ShiftLeft
ShiftRight
CtrlLeft
CtrlRight
Enter
CapsLock
Tab
Apostrophe
Escape
AltLeft
AltRight
Backspace
Space
Num1
Num2
Num3
Num4
Num5
Num6
Num7
Num8
Num9
Num0
NumPad1
NumPad2
NumPad3
NumPad4
NumPad5
NumPad6
NumPad7
NumPad8
NumPad9
Q
W
E
R
T
Y
U
I
O
P
A
S
D
F
G
H
J
K
L
Z
X
C
V
B
N
M
Comma
Period
Slash
SlashBack
Semicolon
BracketOpen
BracketClose
Minus
Equals
Windows
Super
Menu
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
NumLock
NumPadMultiply
NumPadDivide
NumPadMinus
NumPadPlus
NumPadDelete
ArrowUp
ArrowDown
ArrowLeft
ArrowRight
PrintScreen
ScrollLock
Pause
Insert
Home
PageUp
Delete
End
PageDown
BackQuote
Example of usage:
std::cout << "Apostrophe key's state: " << window.keyboard.isKeyPressed(OWL::keyboard::Apostrophe) << "\n";
std::cout << "Is B being typeed in: " << ((window.keyboard.getKeyData().keyEnum == OWL::keyboard::B) ? "yes" : "no") << "\n"; // We should see an pattern of interpolating "yes"'s and "no"'s if the button is pressed.