GameKit  0.0.1a
C++ gamedev tools
GamePad.cpp
Go to the documentation of this file.
1 /*
2  * =====================================================================================
3  *
4  * Filename: GamePad.cpp
5  *
6  * Description:
7  *
8  * Created: 17/01/2018 19:12:09
9  *
10  * Author: Quentin Bazin, <quent42340@gmail.com>
11  *
12  * =====================================================================================
13  */
15 
16 namespace gk {
17 
18 InputHandler *GamePad::inputHandler = nullptr;
19 
21  return (inputHandler) ? inputHandler->isKeyPressed(key) : false;
22 }
23 
25  return (inputHandler) ? inputHandler->isKeyPressedOnce(key) : false;
26 }
27 
29  return (inputHandler) ? inputHandler->isKeyPressedWithDelay(key, delay) : false;
30 }
31 
32 }
33 
static bool isKeyPressed(GameKey key)
Check if a key is pressed.
Definition: GamePad.cpp:20
static bool isKeyPressedOnce(GameKey key)
Check if a key is pressed only one time.
Definition: GamePad.cpp:24
unsigned short u16
Definition: IntTypes.hpp:22
virtual bool isKeyPressedWithDelay(GameKey key, u16 delay)
Check if a key is pressed with delay.
virtual bool isKeyPressedOnce(GameKey key)
Check if a key is pressed only one time.
virtual bool isKeyPressed(GameKey key)
Check if a key is pressed.
static bool isKeyPressedWithDelay(GameKey key, u16 delay)
Check if a key is pressed with delay.
Definition: GamePad.cpp:28
static InputHandler * inputHandler
Current input handler.
Definition: GamePad.hpp:84
u32 GameKey
Alias for game key type.