Initial Lime Gamepad API
This commit is contained in:
20
project/include/ui/Gamepad.h
Normal file
20
project/include/ui/Gamepad.h
Normal 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
|
||||
45
project/include/ui/GamepadEvent.h
Normal file
45
project/include/ui/GamepadEvent.h
Normal 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
|
||||
Reference in New Issue
Block a user