This is joystick.h in view mode; [Download] [Up]
#ifndef _NEXT_JOYSTICK_H
#define _NEXT_JOYSTICK_H
#define JS_RETURN sizeof(struct JS_DATA_TYPE) /*number of bytes returned by js_read*/
#define JS_MAX 2 /*Max number of joysticks*/
#define JS_SET_CAL 0x01 /*ioctl cmd to set joystick correction factor*/
#define JS_GET_CAL 0x02 /*ioctl cmd to get joystick correction factor*/
#define JS_SET_TIMEOUT 0x03 /*ioctl cmd to set maximum number of iterations
to wait for a timeout*/
#define JS_GET_TIMEOUT 0x04 /*as above, to get*/
#define JS_SET_TIMELIMIT 0x05 /*set data retention time*/
#define JS_GET_TIMELIMIT 0x06 /*get data retention time*/
#define JS_GET_ALL 0x07 /*get the whole JS_DATA[minor] struct*/
#define JS_SET_ALL 0x08 /*set the whole JS_DATA[minor] struct
except JS_BUSY!*/
/*This union is used for the ioctl to set the scaling factor and to return
the current values for a joystick. 'buttons' is ignored on the ioctl call*/
struct JS_DATA_TYPE {
int buttons;
int x;
int y;
};
/* This struct is used for misc data about the joystick*/
struct JS_DATA_SAVE_TYPE {
int JS_TIMEOUT; /*timeout*/
int BUSY; /*joystick is in use*/
long JS_EXPIRETIME; /*Time when stick after which stick must be re-read*/
long JS_TIMELIMIT; /*Max time before data is invalid*/
struct JS_DATA_TYPE JS_SAVE; /*last read data*/
struct JS_DATA_TYPE JS_CORR; /*correction factor*/
};
#endif /* _NEXT_JOYSTICK_H */
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.