joystick.h
001: #ifndef _LINUX_JOYSTICK_H
002: #define _LINUX_JOYSTICK_H
003:
004:
005:
006:
007:
008:
009:
010:
011:
012:
013:
014:
015:
016:
017:
018:
019:
020:
021:
022:
023:
024:
025:
026: <vojtech@suse.cz>
027:
028:
029:
030: #include <linux/types.h>
031: #include <linux/input.h>
032:
033:
034:
035:
036:
037: #define JS_VERSION 0x020100
038:
039:
040:
041:
042:
043: #define JS_EVENT_BUTTON 0x01
044: #define JS_EVENT_AXIS 0x02
045: #define JS_EVENT_INIT 0x80
046:
047: struct js_event {
048: __u32 time;
049: __s16 value;
050: __u8 type;
051: __u8 number;
052: };
053:
054:
055:
056:
057:
058: #define JSIOCGVERSION _IOR('j', 0x01, __u32)
059:
060: #define JSIOCGAXES _IOR('j', 0x11, __u8)
061: #define JSIOCGBUTTONS _IOR('j', 0x12, __u8)
062: #define JSIOCGNAME(len) _IOC(_IOC_READ, 'j', 0x13, len)
063:
064: #define JSIOCSCORR _IOW('j', 0x21, struct js_corr)
065: #define JSIOCGCORR _IOR('j', 0x22, struct js_corr)
066:
067: #define JSIOCSAXMAP _IOW('j', 0x31, __u8[ABS_CNT])
068: #define JSIOCGAXMAP _IOR('j', 0x32, __u8[ABS_CNT])
069: #define JSIOCSBTNMAP _IOW('j', 0x33, __u16[KEY_MAX - BTN_MISC + 1])
070: #define JSIOCGBTNMAP _IOR('j', 0x34, __u16[KEY_MAX - BTN_MISC + 1])
071:
072:
073:
074:
075:
076: #define JS_CORR_NONE 0x00
077: #define JS_CORR_BROKEN 0x01
078:
079: struct js_corr {
080: __s32 coef[8];
081: __s16 prec;
082: __u16 type;
083: };
084:
085:
086:
087:
088:
089: #define JS_RETURN sizeof(struct JS_DATA_TYPE)
090: #define JS_TRUE 1
091: #define JS_FALSE 0
092: #define JS_X_0 0x01
093: #define JS_Y_0 0x02
094: #define JS_X_1 0x04
095: #define JS_Y_1 0x08
096: #define JS_MAX 2
097:
098: #define JS_DEF_TIMEOUT 0x1300
099: #define JS_DEF_CORR 0
100: #define JS_DEF_TIMELIMIT 10L
101:
102: #define JS_SET_CAL 1
103: #define JS_GET_CAL 2
104: #define JS_SET_TIMEOUT 3
105: #define JS_GET_TIMEOUT 4
106: #define JS_SET_TIMELIMIT 5
107: #define JS_GET_TIMELIMIT 6
108: #define JS_GET_ALL 7
109: #define JS_SET_ALL 8
110:
111: struct JS_DATA_TYPE {
112: __s32 buttons;
113: __s32 x;
114: __s32 y;
115: };
116:
117: struct JS_DATA_SAVE_TYPE_32 {
118: __s32 JS_TIMEOUT;
119: __s32 BUSY;
120: __s32 JS_EXPIRETIME;
121: __s32 JS_TIMELIMIT;
122: struct JS_DATA_TYPE JS_SAVE;
123: struct JS_DATA_TYPE JS_CORR;
124: };
125:
126: struct JS_DATA_SAVE_TYPE_64 {
127: __s32 JS_TIMEOUT;
128: __s32 BUSY;
129: __s64 JS_EXPIRETIME;
130: __s64 JS_TIMELIMIT;
131: struct JS_DATA_TYPE JS_SAVE;
132: struct JS_DATA_TYPE JS_CORR;
133: };
134:
135:
136: #endif
137:
© Andrew Scott 2006 -
2025,
All Rights Reserved