-
Notifications
You must be signed in to change notification settings - Fork 46
/
joystick.h
29 lines (23 loc) · 918 Bytes
/
joystick.h
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
27
28
29
#ifndef JOYSTICK_H
#define JOYSTICK_H
#include <stdlib.h>
#include <string.h>
#include "runtime.h"
#define NB_JOYSTICKS 8
#define NB_BUTTONS 16
extern const struct joystick_int_const_map {
long value;
const char *name;
} joystick_key_enum[NB_BUTTONS+1];
int lutro_joystick_preload(lua_State *L);
void lutro_joystick_init(void);
void lutro_joystickevent(lua_State* L);
int joystick_getJoystickCount(lua_State *L);
int joystick_isDown(lua_State *L);
int joystick_getAxis(lua_State *L);
const char* joystick_retroToJoystick(unsigned joystickKey);
int joystick_joystickToRetro(const char* retroKey);
void lutro_joystickInvokeJoystickEvent(lua_State* L, char* eventName, int joystick, int button);
int joystick_find_value(const struct joystick_int_const_map *map, const char *name, unsigned *value);
const char* joystick_find_name(const struct joystick_int_const_map *map, unsigned value);
#endif // JOYSTICK_H