summaryrefslogtreecommitdiff
path: root/src/keyboard.h
blob: 6853ffca0de536ef573c743d8c5a3702574972db (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
#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;
};

#endif