Initial Lime Gamepad API

This commit is contained in:
Joshua Granick
2015-03-18 01:42:56 -07:00
parent f4c9880cce
commit cfbf3f4a3f
15 changed files with 460 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
#ifndef LIME_UI_GAMEPAD_H
#define LIME_UI_GAMEPAD_H
namespace lime {
class Gamepad {
public:
static const char* GetDeviceName (int id);
};
}
#endif

View File

@@ -0,0 +1,45 @@
#ifndef LIME_UI_GAMEPAD_EVENT_H
#define LIME_UI_GAMEPAD_EVENT_H
#include <hx/CFFI.h>
namespace lime {
enum GamepadEventType {
AXIS_MOVE,
BUTTON_DOWN,
BUTTON_UP,
CONNECT,
DISCONNECT
};
class GamepadEvent {
public:
static AutoGCRoot* callback;
static AutoGCRoot* eventObject;
GamepadEvent ();
static void Dispatch (GamepadEvent* event);
int axis;
double axisValue;
int button;
int id;
GamepadEventType type;
};
}
#endif