summaryrefslogtreecommitdiff
path: root/src/keyboard.h
blob: 53a1843494b97b8b72ffc2927ee4bef35f3d3e18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef KEYHANDLER_H
#define KEYHANDLER_H
#include<SDL2/SDL.h>
#include "command.h"

class Keyboard{

    public:
        Keyboard();
        ~Keyboard();
        Command* handleEvent( SDL_Event e );
        Command* pressed( SDL_Keycode k, Uint16 mod = 0);
        Command* released( SDL_Keycode k, Uint16 mod = 0);

        // Modifiers: https://wiki.libsdl.org/SDL_Keymod
        // Keycodes:  https://wiki.libsdl.org/SDL_Keycode
    private:
        Command* nop;
        Command* pressedDown;
        Command* releasedDown;
        Command* pressedLeft;
        Command* pressedRight;
        Command* pressedSpace;
};

#endif