|
xwiimote 2
|
Main libxwiimote API. More...
#include <stdbool.h>#include <stdint.h>#include <stdlib.h>#include <sys/time.h>#include <time.h>Go to the source code of this file.
Data Structures | |
| struct | xwii_event_key |
| Key Event Payload. More... | |
| struct | xwii_event_abs |
| Absolute Motion Payload. More... | |
| union | xwii_event_union |
| Event Payload. More... | |
| struct | xwii_event |
| Event Object. More... | |
Macros | |
| #define | XWII__DEPRECATED |
| #define | XWII__NAME "Nintendo Wii Remote" |
| #define | XWII_NAME_CORE XWII__NAME |
| Name of the core input device. | |
| #define | XWII_NAME_ACCEL XWII__NAME " Accelerometer" |
| Name of the accelerometer input device. | |
| #define | XWII_NAME_IR XWII__NAME " IR" |
| Name of the IR input device. | |
| #define | XWII_NAME_MOTION_PLUS XWII__NAME " Motion Plus" |
| Name of the motion-plus input device. | |
| #define | XWII_NAME_NUNCHUK XWII__NAME " Nunchuk" |
| Name of the nunchuk input device. | |
| #define | XWII_NAME_CLASSIC_CONTROLLER XWII__NAME " Classic Controller" |
| Name of the classic-controller input device. | |
| #define | XWII_NAME_BALANCE_BOARD XWII__NAME " Balance Board" |
| Name of the balance-board input device. | |
| #define | XWII_NAME_PRO_CONTROLLER XWII__NAME " Pro Controller" |
| Name of the pro-controller input device. | |
| #define | XWII_NAME_DRUMS XWII__NAME " Drums" |
| Name of the drums-controller input device. | |
| #define | XWII_NAME_GUITAR XWII__NAME " Guitar" |
| Name of the guitar-controller input device. | |
| #define | XWII_ABS_NUM 8 |
| Number of ABS values in an xwii_event_union. | |
| #define | XWII_LED(num) (XWII_LED1 + (num) - 1) |
| Create enum xwii_led constants during runtime. | |
Functions | |
| const char * | xwii_get_iface_name (unsigned int iface) |
| Return name of a given interface. | |
| int | xwii_iface_new (struct xwii_iface **dev, const char *syspath) |
| Create new device object from syspath path. | |
| void | xwii_iface_ref (struct xwii_iface *dev) |
| Increase ref-count by 1. | |
| void | xwii_iface_unref (struct xwii_iface *dev) |
| Decrease ref-count by 1. | |
| const char * | xwii_iface_get_syspath (struct xwii_iface *dev) |
| Return device syspath. | |
| int | xwii_iface_get_fd (struct xwii_iface *dev) |
| Return file-descriptor. | |
| int | xwii_iface_watch (struct xwii_iface *dev, bool watch) |
| Watch device for hotplug events. | |
| int | xwii_iface_open (struct xwii_iface *dev, unsigned int ifaces) |
| Open interfaces on this device. | |
| void | xwii_iface_close (struct xwii_iface *dev, unsigned int ifaces) |
| Close interfaces on this device. | |
| unsigned int | xwii_iface_opened (struct xwii_iface *dev) |
| Return bitmask of opened interfaces. | |
| unsigned int | xwii_iface_available (struct xwii_iface *dev) |
| Return bitmask of available interfaces. | |
| XWII__DEPRECATED int | xwii_iface_poll (struct xwii_iface *dev, struct xwii_event *ev) |
| Read incoming event-queue. | |
| int | xwii_iface_dispatch (struct xwii_iface *dev, struct xwii_event *ev, size_t size) |
| Read incoming event-queue. | |
| int | xwii_iface_rumble (struct xwii_iface *dev, bool on) |
| Toggle rumble motor. | |
| int | xwii_iface_get_led (struct xwii_iface *dev, unsigned int led, bool *state) |
| Read LED state. | |
| int | xwii_iface_set_led (struct xwii_iface *dev, unsigned int led, bool state) |
| Set LED state. | |
| int | xwii_iface_get_battery (struct xwii_iface *dev, uint8_t *capacity) |
| Read battery state. | |
| int | xwii_iface_get_devtype (struct xwii_iface *dev, char **devtype) |
| Read device type. | |
| int | xwii_iface_get_extension (struct xwii_iface *dev, char **extension) |
| Read extension type. | |
| void | xwii_iface_set_mp_normalization (struct xwii_iface *dev, int32_t x, int32_t y, int32_t z, int32_t factor) |
| Set MP normalization and calibration. | |
| void | xwii_iface_get_mp_normalization (struct xwii_iface *dev, int32_t *x, int32_t *y, int32_t *z, int32_t *factor) |
| Read MP normalization and calibration. | |
| struct xwii_monitor * | xwii_monitor_new (bool poll, bool direct) |
| Create a new monitor. | |
| void | xwii_monitor_ref (struct xwii_monitor *mon) |
| Increase monitor ref-count by 1. | |
| void | xwii_monitor_unref (struct xwii_monitor *mon) |
| Decrease monitor ref-count by 1. | |
| int | xwii_monitor_get_fd (struct xwii_monitor *monitor, bool blocking) |
| Return internal fd. | |
| char * | xwii_monitor_poll (struct xwii_monitor *monitor) |
| Read incoming events. | |
Main libxwiimote API.
This file defines the public libxwiimote API and ABI. All identifiers are prefixed either with XWII_ or xwii_. Note that all identifiers prefixed with a double-underscore (XWII__ or xwii__) are not part of the stable ABI and may change at any time.