31#define XWII__DEPRECATED __attribute__((__deprecated__))
33#define XWII__DEPRECATED
332#define XWII__NAME "Nintendo Wii Remote"
335#define XWII_NAME_CORE XWII__NAME
337#define XWII_NAME_ACCEL XWII__NAME " Accelerometer"
339#define XWII_NAME_IR XWII__NAME " IR"
342#define XWII_NAME_MOTION_PLUS XWII__NAME " Motion Plus"
344#define XWII_NAME_NUNCHUK XWII__NAME " Nunchuk"
346#define XWII_NAME_CLASSIC_CONTROLLER XWII__NAME " Classic Controller"
348#define XWII_NAME_BALANCE_BOARD XWII__NAME " Balance Board"
350#define XWII_NAME_PRO_CONTROLLER XWII__NAME " Pro Controller"
352#define XWII_NAME_DRUMS XWII__NAME " Drums"
354#define XWII_NAME_GUITAR XWII__NAME " Guitar"
769#define XWII_ABS_NUM 8
814 return abs->x != 1023 ||
abs->y != 1023;
940#define XWII_LED(num) (XWII_LED1 + (num) - 1)
1254 int32_t y, int32_t z, int32_t factor);
1276 int32_t *y, int32_t *z, int32_t *factor);
int xwii_iface_get_led(struct xwii_iface *dev, unsigned int led, bool *state)
Read LED state.
int xwii_iface_get_extension(struct xwii_iface *dev, char **extension)
Read extension type.
int xwii_iface_watch(struct xwii_iface *dev, bool watch)
Watch device for hotplug events.
const char * xwii_iface_get_syspath(struct xwii_iface *dev)
Return device syspath.
int xwii_iface_open(struct xwii_iface *dev, unsigned int ifaces)
Open interfaces on this device.
int xwii_iface_rumble(struct xwii_iface *dev, bool on)
Toggle rumble motor.
int xwii_iface_get_devtype(struct xwii_iface *dev, char **devtype)
Read device type.
xwii_iface_type
Interfaces.
Definition: xwiimote.h:871
void xwii_iface_ref(struct xwii_iface *dev)
Increase ref-count by 1.
const char * xwii_get_iface_name(unsigned int iface)
Return name of a given interface.
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.
unsigned int xwii_iface_available(struct xwii_iface *dev)
Return bitmask of available interfaces.
int xwii_iface_new(struct xwii_iface **dev, const char *syspath)
Create new device object from syspath path.
int xwii_iface_dispatch(struct xwii_iface *dev, struct xwii_event *ev, size_t size)
Read incoming event-queue.
int xwii_iface_set_led(struct xwii_iface *dev, unsigned int led, bool state)
Set LED state.
void xwii_iface_close(struct xwii_iface *dev, unsigned int ifaces)
Close interfaces on this device.
XWII__DEPRECATED int xwii_iface_poll(struct xwii_iface *dev, struct xwii_event *ev)
Read incoming event-queue.
int xwii_iface_get_fd(struct xwii_iface *dev)
Return file-descriptor.
int xwii_iface_get_battery(struct xwii_iface *dev, uint8_t *capacity)
Read battery state.
xwii_led
LEDs.
Definition: xwiimote.h:927
void xwii_iface_unref(struct xwii_iface *dev)
Decrease ref-count by 1.
unsigned int xwii_iface_opened(struct xwii_iface *dev)
Return bitmask of opened interfaces.
@ XWII_IFACE_CORE
Core interface.
Definition: xwiimote.h:873
@ XWII_IFACE_PRO_CONTROLLER
ProController extension interface.
Definition: xwiimote.h:888
@ XWII_IFACE_GUITAR
Guitar extension interface.
Definition: xwiimote.h:892
@ XWII_IFACE_BALANCE_BOARD
BalanceBoard extension interface.
Definition: xwiimote.h:886
@ XWII_IFACE_ALL
Special flag ORed with all valid interfaces.
Definition: xwiimote.h:895
@ XWII_IFACE_CLASSIC_CONTROLLER
ClassicController extension interface.
Definition: xwiimote.h:884
@ XWII_IFACE_DRUMS
Drums extension interface.
Definition: xwiimote.h:890
@ XWII_IFACE_MOTION_PLUS
MotionPlus extension interface.
Definition: xwiimote.h:880
@ XWII_IFACE_NUNCHUK
Nunchuk extension interface.
Definition: xwiimote.h:882
@ XWII_IFACE_WRITABLE
Special flag which causes the interfaces to be opened writable.
Definition: xwiimote.h:906
@ XWII_IFACE_IR
IR interface.
Definition: xwiimote.h:877
@ XWII_IFACE_ACCEL
Accelerometer interface.
Definition: xwiimote.h:875
xwii_event_keys
Key Event Identifiers.
Definition: xwiimote.h:597
#define XWII_ABS_NUM
Number of ABS values in an xwii_event_union.
Definition: xwiimote.h:769
xwii_event_types
Event Types.
Definition: xwiimote.h:377
xwii_drums_abs
Absolute Drum-Motion Indices.
Definition: xwiimote.h:747
@ XWII_KEY_THUMBR
Right thumb button.
Definition: xwiimote.h:632
@ XWII_KEY_STRUM_BAR_DOWN
Guitar Strum-bar-down event.
Definition: xwiimote.h:664
@ XWII_KEY_FRET_MID
Guitar Fret-Mid event.
Definition: xwiimote.h:685
@ XWII_KEY_FRET_UP
Guitar Fret-Up event.
Definition: xwiimote.h:678
@ XWII_KEY_Z
Extra Z button.
Definition: xwiimote.h:650
@ XWII_KEY_NUM
Number of key identifiers.
Definition: xwiimote.h:708
@ XWII_KEY_FRET_LOW
Guitar Fret-Low event.
Definition: xwiimote.h:692
@ XWII_KEY_FRET_FAR_LOW
Guitar Fret-Far-Low event.
Definition: xwiimote.h:699
@ XWII_KEY_C
Extra C button.
Definition: xwiimote.h:641
@ XWII_KEY_FRET_FAR_UP
Guitar Fret-Far-Up event.
Definition: xwiimote.h:671
@ XWII_KEY_THUMBL
Left thumb button.
Definition: xwiimote.h:623
@ XWII_KEY_STRUM_BAR_UP
Guitar Strum-bar-up event.
Definition: xwiimote.h:657
@ XWII_EVENT_GUITAR_MOVE
Guitar movement event.
Definition: xwiimote.h:561
@ XWII_EVENT_DRUMS_MOVE
Drums movement event.
Definition: xwiimote.h:539
@ XWII_EVENT_NUNCHUK_KEY
Nunchuk key event.
Definition: xwiimote.h:510
@ XWII_EVENT_KEY
Core-interface key event.
Definition: xwiimote.h:386
@ XWII_EVENT_PRO_CONTROLLER_KEY
Pro-Controller key event.
Definition: xwiimote.h:444
@ XWII_EVENT_NUM
Number of available event types.
Definition: xwiimote.h:580
@ XWII_EVENT_GONE
Removal Event.
Definition: xwiimote.h:572
@ XWII_EVENT_CLASSIC_CONTROLLER_KEY
Classic Controller key event.
Definition: xwiimote.h:485
@ XWII_EVENT_ACCEL
Accelerometer event.
Definition: xwiimote.h:397
@ XWII_EVENT_MOTION_PLUS
Motion-Plus event.
Definition: xwiimote.h:433
@ XWII_EVENT_NUNCHUK_MOVE
Nunchuk movement event.
Definition: xwiimote.h:520
@ XWII_EVENT_BALANCE_BOARD
Balance-Board event.
Definition: xwiimote.h:422
@ XWII_EVENT_PRO_CONTROLLER_MOVE
Pro-Controller movement event.
Definition: xwiimote.h:454
@ XWII_EVENT_WATCH
Hotplug Event.
Definition: xwiimote.h:473
@ XWII_EVENT_CLASSIC_CONTROLLER_MOVE
Classic Controller movement event.
Definition: xwiimote.h:499
@ XWII_EVENT_DRUMS_KEY
Drums key event.
Definition: xwiimote.h:529
@ XWII_EVENT_IR
IR-Camera event.
Definition: xwiimote.h:411
@ XWII_EVENT_GUITAR_KEY
Guitar key event.
Definition: xwiimote.h:550
@ XWII_DRUMS_ABS_BASS
Bass pressure, just X direction.
Definition: xwiimote.h:761
@ XWII_DRUMS_ABS_TOM_LEFT
Mid-left tom pressure, just X direction.
Definition: xwiimote.h:755
@ XWII_DRUMS_ABS_TOM_FAR_RIGHT
Right-most tom pressure, just X direction.
Definition: xwiimote.h:759
@ XWII_DRUMS_ABS_CYMBAL_RIGHT
Cymbal pressure, just X direction.
Definition: xwiimote.h:753
@ XWII_DRUMS_ABS_TOM_RIGHT
Mid-right tom pressure, just X direction.
Definition: xwiimote.h:757
@ XWII_DRUMS_ABS_CYMBAL_LEFT
Cymbal pressure, just X direction.
Definition: xwiimote.h:751
@ XWII_DRUMS_ABS_PAD
Control pad motion.
Definition: xwiimote.h:749
@ XWII_DRUMS_ABS_HI_HAT
Hi-Hat pressure, just X direction.
Definition: xwiimote.h:763
@ XWII_DRUMS_ABS_NUM
Number of drums payloads, may get increased for new ones.
Definition: xwiimote.h:765
void xwii_monitor_ref(struct xwii_monitor *mon)
Increase monitor ref-count by 1.
char * xwii_monitor_poll(struct xwii_monitor *monitor)
Read incoming events.
int xwii_monitor_get_fd(struct xwii_monitor *monitor, bool blocking)
Return internal fd.
void xwii_monitor_unref(struct xwii_monitor *mon)
Decrease monitor ref-count by 1.
struct xwii_monitor * xwii_monitor_new(bool poll, bool direct)
Create a new monitor.
Absolute Motion Payload.
Definition: xwiimote.h:729
Key Event Payload.
Definition: xwiimote.h:716
unsigned int state
key state copied from kernel (0: up, 1: down, 2: auto-repeat)
Definition: xwiimote.h:720
unsigned int code
key identifier defined as enum xwii_event_keys
Definition: xwiimote.h:718
Event Object.
Definition: xwiimote.h:794
union xwii_event_union v
data payload
Definition: xwiimote.h:801
struct timeval time
timestamp when this event was generated (copied from kernel)
Definition: xwiimote.h:796
unsigned int type
event type ref xwii_event_types
Definition: xwiimote.h:798
Event Payload.
Definition: xwiimote.h:776
struct xwii_event_key key
key event payload
Definition: xwiimote.h:778
uint8_t reserved[128]
reserved; do not use!
Definition: xwiimote.h:782
struct xwii_event_abs abs[XWII_ABS_NUM]
absolute motion event payload
Definition: xwiimote.h:780