7 #ifndef XWII_XWIIMOTE_H
8 #define XWII_XWIIMOTE_H
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);
1301 struct xwii_monitor;
int xwii_iface_get_extension(struct xwii_iface *dev, char **extension)
Read extension type.
void xwii_monitor_ref(struct xwii_monitor *mon)
Increase monitor ref-count by 1.
Right thumb button.
Definition: xwiimote.h:632
int xwii_iface_watch(struct xwii_iface *dev, bool watch)
Watch device for hotplug events.
union xwii_event_union v
data payload
Definition: xwiimote.h:801
Hotplug Event.
Definition: xwiimote.h:473
unsigned int state
key state copied from kernel (0: up, 1: down, 2: auto-repeat)
Definition: xwiimote.h:720
Number of drums payloads, may get increased for new ones.
Definition: xwiimote.h:765
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.
unsigned int xwii_iface_available(struct xwii_iface *dev)
Return bitmask of available interfaces.
Bass pressure, just X direction.
Definition: xwiimote.h:761
Drums extension interface.
Definition: xwiimote.h:890
Guitar Strum-bar-down event.
Definition: xwiimote.h:664
int xwii_iface_new(struct xwii_iface **dev, const char *syspath)
Create new device object from syspath path.
Right-most tom pressure, just X direction.
Definition: xwiimote.h:759
xwii_event_types
Event Types.
Definition: xwiimote.h:377
Event Payload.
Definition: xwiimote.h:776
XWII__DEPRECATED int xwii_iface_poll(struct xwii_iface *dev, struct xwii_event *ev)
Read incoming event-queue.
Drums movement event.
Definition: xwiimote.h:539
int xwii_iface_get_fd(struct xwii_iface *dev)
Return file-descriptor.
const char * xwii_iface_get_syspath(struct xwii_iface *dev)
Return device syspath.
Number of key identifiers.
Definition: xwiimote.h:708
struct xwii_monitor * xwii_monitor_new(bool poll, bool direct)
Create a new monitor.
Removal Event.
Definition: xwiimote.h:572
Guitar Strum-bar-up event.
Definition: xwiimote.h:657
Event Object.
Definition: xwiimote.h:794
Number of available event types.
Definition: xwiimote.h:580
void xwii_iface_ref(struct xwii_iface *dev)
Increase ref-count by 1.
char * xwii_monitor_poll(struct xwii_monitor *monitor)
Read incoming events.
xwii_iface_type
Interfaces.
Definition: xwiimote.h:871
Extra Z button.
Definition: xwiimote.h:650
Drums key event.
Definition: xwiimote.h:529
Nunchuk movement event.
Definition: xwiimote.h:520
struct timeval time
timestamp when this event was generated (copied from kernel)
Definition: xwiimote.h:796
Guitar Fret-Low event.
Definition: xwiimote.h:692
int xwii_iface_get_led(struct xwii_iface *dev, unsigned int led, bool *state)
Read LED state.
IR-Camera event.
Definition: xwiimote.h:411
Guitar key event.
Definition: xwiimote.h:550
Mid-left tom pressure, just X direction.
Definition: xwiimote.h:755
Nunchuk key event.
Definition: xwiimote.h:510
unsigned int code
key identifier defined as enum xwii_event_keys
Definition: xwiimote.h:718
Core interface.
Definition: xwiimote.h:873
int xwii_iface_get_devtype(struct xwii_iface *dev, char **devtype)
Read device type.
Accelerometer event.
Definition: xwiimote.h:397
uint8_t reserved[128]
reserved; do not use!
Definition: xwiimote.h:782
const char * xwii_get_iface_name(unsigned int iface)
Return name of a given interface.
Cymbal pressure, just X direction.
Definition: xwiimote.h:753
Left thumb button.
Definition: xwiimote.h:623
Guitar movement event.
Definition: xwiimote.h:561
Guitar Fret-Far-Low event.
Definition: xwiimote.h:699
int xwii_iface_set_led(struct xwii_iface *dev, unsigned int led, bool state)
Set LED state.
Classic Controller key event.
Definition: xwiimote.h:485
int xwii_iface_get_battery(struct xwii_iface *dev, uint8_t *capacity)
Read battery state.
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.
MotionPlus extension interface.
Definition: xwiimote.h:880
xwii_drums_abs
Absolute Drum-Motion Indices.
Definition: xwiimote.h:747
Special flag ORed with all valid interfaces.
Definition: xwiimote.h:895
Core-interface key event.
Definition: xwiimote.h:386
Pro-Controller movement event.
Definition: xwiimote.h:454
xwii_event_keys
Key Event Identifiers.
Definition: xwiimote.h:597
Guitar extension interface.
Definition: xwiimote.h:892
unsigned int type
event type ref xwii_event_types
Definition: xwiimote.h:798
Accelerometer interface.
Definition: xwiimote.h:875
int xwii_iface_open(struct xwii_iface *dev, unsigned int ifaces)
Open interfaces on this device.
Nunchuk extension interface.
Definition: xwiimote.h:882
Guitar Fret-Mid event.
Definition: xwiimote.h:685
Guitar Fret-Up event.
Definition: xwiimote.h:678
#define XWII_ABS_NUM
Number of ABS values in an xwii_event_union.
Definition: xwiimote.h:769
IR interface.
Definition: xwiimote.h:877
int xwii_iface_rumble(struct xwii_iface *dev, bool on)
Toggle rumble motor.
Hi-Hat pressure, just X direction.
Definition: xwiimote.h:763
ClassicController extension interface.
Definition: xwiimote.h:884
Cymbal pressure, just X direction.
Definition: xwiimote.h:751
Classic Controller movement event.
Definition: xwiimote.h:499
void xwii_monitor_unref(struct xwii_monitor *mon)
Decrease monitor ref-count by 1.
BalanceBoard extension interface.
Definition: xwiimote.h:886
ProController extension interface.
Definition: xwiimote.h:888
struct xwii_event_abs abs[XWII_ABS_NUM]
absolute motion event payload
Definition: xwiimote.h:780
Balance-Board event.
Definition: xwiimote.h:422
Key Event Payload.
Definition: xwiimote.h:716
void xwii_iface_unref(struct xwii_iface *dev)
Decrease ref-count by 1.
xwii_led
LEDs.
Definition: xwiimote.h:927
Mid-right tom pressure, just X direction.
Definition: xwiimote.h:757
unsigned int xwii_iface_opened(struct xwii_iface *dev)
Return bitmask of opened interfaces.
Motion-Plus event.
Definition: xwiimote.h:433
struct xwii_event_key key
key event payload
Definition: xwiimote.h:778
Special flag which causes the interfaces to be opened writable.
Definition: xwiimote.h:906
void xwii_iface_close(struct xwii_iface *dev, unsigned int ifaces)
Close interfaces on this device.
Control pad motion.
Definition: xwiimote.h:749
Pro-Controller key event.
Definition: xwiimote.h:444
int xwii_monitor_get_fd(struct xwii_monitor *monitor, bool blocking)
Return internal fd.
Extra C button.
Definition: xwiimote.h:641
int xwii_iface_dispatch(struct xwii_iface *dev, struct xwii_event *ev, size_t size)
Read incoming event-queue.
Absolute Motion Payload.
Definition: xwiimote.h:729
Guitar Fret-Far-Up event.
Definition: xwiimote.h:671