Files
pumpitupdev_pumptools/src/main/io/util/joystick.h
T
icex2 eafb2909d1 Appl new code style on whole code base
Use a similar code style to bemanitools though reduce indentation
to 2 spaces. Also some other tweaks to be more similar to google
style.
2021-03-19 15:52:34 +01:00

29 lines
628 B
C

#ifndef IO_UTIL_JOYSTICK_H
#define IO_UTIL_JOYSTICK_H
#include <linux/limits.h>
#include <stdbool.h>
#include <stdint.h>
#define JOYSTICK_NAME_LEN 128
struct io_util_joystick {
char dev_path[PATH_MAX];
int handle;
uint16_t num_buttons;
uint16_t num_axes;
char name[JOYSTICK_NAME_LEN];
bool *button_state;
};
bool io_util_joystick_open(const char *dev_path, struct io_util_joystick **ctx);
bool io_util_joystick_close(struct io_util_joystick *ctx);
bool io_util_joystick_update(struct io_util_joystick *ctx);
bool io_util_joystick_is_button_pressed(
struct io_util_joystick *ctx, uint16_t button);
#endif