The function works as intended, and states whether the key is down or not. But, it can be problematic to process user input while the game window is in the background and another window is the focus.
example:
Take a game with arrow keys are used for player movement. By simply using IsKeyDown, if the key is pressed while in another window, the player will still move even if the window is in the background.
Perhaps another state function like IsWindowFocused() is needed?
if (window.IsWindowFocused()) {
if (window.IsKeyDown(KeyboardKey.Up)) {
// ...
}
}
The function works as intended, and states whether the key is down or not. But, it can be problematic to process user input while the game window is in the background and another window is the focus.
example: Take a game with arrow keys are used for player movement. By simply using IsKeyDown, if the key is pressed while in another window, the player will still move even if the window is in the background.
Perhaps another state function like IsWindowFocused() is needed?