Meteor2D  dev internal
Meteor is a lightweight 2D game engine.
Loading...
Searching...
No Matches
inputmanagement.h
1#pragma once
2#include <SDL.h>
3#include <set>
4#include <entities/entity.h>
5#include <input/keycodes.h>
6
7namespace meteor {
11 class MInputManager : public MEntity {
12 public:
16 static void initialise();
20 static void update();
26 static bool getKey(EKeyCode key);
32 static bool getKeyDown(EKeyCode key);
38 static bool getKeyUp(EKeyCode key);
39 private:
40 static const Uint8* keyStates;
41 static Uint8 prevKeyStates[SDL_NUM_SCANCODES];
42 static std::set<EKeyCode> keyMemory;
43 };
44}
An Entity is the base class for all data and behaviour oriented objects in meteor....
Definition entity.h:9
manages user input events.
Definition inputmanagement.h:11
static void update()
request InputManager to refresh its input state.
static void initialise()
Initialise the input manager, IMP: DO NOT TOUCH or INVOKE.
static bool getKey(EKeyCode key)
Returns true if a key if held down, on release returns false.
static bool getKeyDown(EKeyCode key)
Returns true if a key was pressed and then released.
static bool getKeyUp(EKeyCode key)
Returns true if a key was released.