getInput
How to use these functions ?
void onUpdate() {
//vertical variable take a value between -1.0f and 1.0f
float vertical = getInput().getAxis("Vertical");
//check is there is action with a key (but do not precise the actions)
if (getInput().getKey(KapEngine::Events::Key::UP)) {
//do something
}
//check if key is pressed
if (getInput().getKeyDown(KapEngine::Events::Key::UP)) {
//do something
}
//check if key is released
if (getInput().getKeyUp(KapEngine::Events::Key::UP)) {
//do something
}
}Last updated