OWL

OWL - Open Windowing Library


Keyboard

keyboard is an element of Window. It’s used for handling keyboard events.

It has 2 functions:

Example of usage:

/* Before the main loop */
std::wstring text = "";

/* In the main loop */
if(window.keyboard.getKeyData().keyChar != '\b') {
	text += window.keyboard.getKeyData().keyChar;
}
else {
	text.resize(text.size() - 1);
}

std::cout << "Is F1 key pressed: (" << window.keyboard.isKeyPressed(OWL::keyboard::F1) << ")\n";
std::cout << "Key pressed: {" << window.keyboard.getKeyData().keyChar << "}\n";
std::wcout << "Text written: {" << text << "}\n";