Tachyon (current)
Current Main Branch
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/time.h>
#include <linux/input.h>
#include "eventio.h"
Go to the source code of this file.
Data Structures | |
struct | evio |
Macros | |
#define | REL_RX 0x03 |
#define | REL_RY 0x04 |
#define | REL_RZ 0x05 |
#define | EVIO_LBIT (8*sizeof(long)) |
#define | EVIO_BITSTOLONGS(bnr) (((bnr) + EVIO_LBIT - 1) / EVIO_LBIT) |
#define | EVIO_TESTBIT(bnr, array) (((1UL << ((bnr)&(EVIO_LBIT-1))) & ((array)[(bnr)/EVIO_LBIT]))!=0) |
Functions | |
evio_handle | evio_open (const char *devpath) |
int | evio_close (evio_handle v) |
int | evio_dev_joystick (evio_handle v) |
int | evio_dev_spaceball (evio_handle v) |
int | evio_dev_recognized (evio_handle v) |
int | evio_read_events (evio_handle v) |
float | evio_absinfo2float (struct input_absinfo *absinfo) |
int | evio_get_button_status (evio_handle v, int evbtn, int btnflag) |
int | evio_get_joystick_status (evio_handle v, float *abs_x1, float *abs_y1, float *abs_x2, float *abs_y2, int *buttons) |
int | evio_get_spaceball_status (evio_handle v, int *rel_x, int *rel_y, int *rel_z, int *rel_rx, int *rel_ry, int *rel_rz, int *buttons) |
int | evio_print_devinfo (evio_handle v) |
#define EVIO_TESTBIT | ( | bnr, | |
array | |||
) | (((1UL << ((bnr)&(EVIO_LBIT-1))) & ((array)[(bnr)/EVIO_LBIT]))!=0) |
Definition at line 77 of file eventio.c.
Referenced by evio_get_button_status(), evio_get_joystick_status(), evio_get_spaceball_status(), and evio_open().
#define REL_RX 0x03 |
Definition at line 62 of file eventio.c.
Referenced by evio_get_spaceball_status(), and evio_open().
#define REL_RY 0x04 |
Definition at line 65 of file eventio.c.
Referenced by evio_get_spaceball_status(), and evio_open().
#define REL_RZ 0x05 |
Definition at line 68 of file eventio.c.
Referenced by evio_get_spaceball_status(), and evio_open().
float evio_absinfo2float | ( | struct input_absinfo * | absinfo | ) |
Definition at line 282 of file eventio.c.
Referenced by evio_get_joystick_status().
int evio_close | ( | evio_handle | v | ) |
int evio_dev_joystick | ( | evio_handle | v | ) |
Definition at line 181 of file eventio.c.
References evio::devjoystick.
int evio_dev_recognized | ( | evio_handle | v | ) |
Definition at line 203 of file eventio.c.
References evio::devjoystick, and evio::devspaceball.
Referenced by evio_print_devinfo().
int evio_dev_spaceball | ( | evio_handle | v | ) |
Definition at line 192 of file eventio.c.
References evio::devspaceball.
int evio_get_button_status | ( | evio_handle | v, |
int | evbtn, | ||
int | btnflag | ||
) |
Definition at line 289 of file eventio.c.
References EVIO_TESTBIT, and evio::keystate.
Referenced by evio_get_joystick_status().
int evio_get_joystick_status | ( | evio_handle | v, |
float * | abs_x1, | ||
float * | abs_y1, | ||
float * | abs_x2, | ||
float * | abs_y2, | ||
int * | buttons | ||
) |
Definition at line 300 of file eventio.c.
References evio::devjoystick, EVENTIO_BACK, EVENTIO_GAMEPAD_A, EVENTIO_GAMEPAD_B, EVENTIO_GAMEPAD_X, EVENTIO_GAMEPAD_Y, EVENTIO_JOYSTICK_LOGIF310, EVENTIO_JOYSTICK_NYKO, EVENTIO_JOYSTICK_STD, EVENTIO_START, EVENTIO_TASK, EVENTIO_THUMBL, EVENTIO_THUMBR, EVENTIO_TL, EVENTIO_TR, evio_absinfo2float(), evio_get_button_status(), EVIO_TESTBIT, evio::fd, evio::keybit, and evio::keystate.
int evio_get_spaceball_status | ( | evio_handle | v, |
int * | rel_x, | ||
int * | rel_y, | ||
int * | rel_z, | ||
int * | rel_rx, | ||
int * | rel_ry, | ||
int * | rel_rz, | ||
int * | buttons | ||
) |
evio_handle evio_open | ( | const char * | devpath | ) |
Definition at line 96 of file eventio.c.
References evio::absbit, evio::devid, evio::devjoystick, evio::devname, evio::devpath, evio::devspaceball, evio::evbit, EVENTIO_JOYSTICK_LOGIF310, EVENTIO_JOYSTICK_NYKO, EVENTIO_JOYSTICK_STD, EVENTIO_SPACEBALL_STD, EVIO_TESTBIT, evio::fd, evio::keybit, REL_RX, REL_RY, REL_RZ, and evio::relbit.
int evio_print_devinfo | ( | evio_handle | v | ) |
Definition at line 467 of file eventio.c.
References evio::devid, evio::devjoystick, evio::devname, evio::devpath, evio::devspaceball, EVENTIO_ERROR, EVENTIO_SUCCESS, and evio_dev_recognized().
int evio_read_events | ( | evio_handle | v | ) |
Definition at line 213 of file eventio.c.
References evio::fd, and evio::inpev.