ELEC2645 (2018/19) / Mbed 2 deprecated el17ajf

Dependencies:   mbed

Fork of el17ajf by Angus Findlay

Input/Input.h

Committer:
el17ajf
Date:
2019-03-17
Revision:
12:beb0d7632531
Parent:
9:3a7776a29a11
Child:
13:59e17cab320a

File content as of revision 12:beb0d7632531:

#include "Gamepad.h"

class Input {
public:
    static const int NUMBER_OF_BUTTONS; 
    enum Button {LEFT, RIGHT, UP, DOWN};
    enum State {RELEASED, RELEASED_FRAME, HIT_FRAME, HELD};
    static void init();
    static void deinit();
    static void update();
    static bool buttonHit(Button button);
    static bool buttonHeld(Button button);
private:
    static State states[4];
    static Gamepad * gamepad;
};