2. Input Handling - a-roy/pacman-mp GitHub Wiki

We define a library-agnostic header for an InputHandler class, which polls for inputs and can be queried for the user's last input and time since last input. Since Pac-Man only has 4 possible inputs (Up, Down, Left, and Right), has no simultaneous inputs, and has no checks required for released inputs, this simple querying scheme is sufficient for handling a player's input. While the game itself does not need to check the time since the player's last input, it is useful for implementing menus.

The SFML-based implementation of this class is in SFInputHandler.cpp.