1#ifndef __VSF_LINUX_INPUT_H__
2#define __VSF_LINUX_INPUT_H__
6#if VSF_USE_INPUT == ENABLED
8#if VSF_LINUX_CFG_RELATIVE_PATH == ENABLED
18#include <linux/device.h>
25#define EVIOCGMTSLOTS(len) _IOC(_IOC_READ, 'E', 0x0a, len)
26#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len)
27#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len)
28#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len)
29#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len)
30#define EVIOCGBIT(ev, len) _IOC(_IOC_READ, 'E', 0x20 + (ev), len)
31#define EVIOCGABS(abs) _IOR('E', 0x40 + (abs), struct input_absinfo)
32#define EVIOCSABS(abs) _IOW('E', 0xc0 + (abs), struct input_absinfo)
33#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect))
34#define EVIOCRMFF _IOW('E', 0x81, int)
35#define EVIOCGEFFECTS _IOR('E', 0x84, int)
36#define EVIOCGRAB _IOW('E', 0x90, int)
37#define EVIOCREVOKE _IOW('E', 0x91, int)
38#define EVIOCSCLOCKID _IOW('E', 0xa0, int)
39#define EVIOCGVERSION _IOR('E', 0x01, int)
40#define EVIOCGID _IOR('E', 0x02, struct input_id)
41#define EVIOCGREP _IOR('E', 0x03, unsigned int[2])
42#define EVIOCSREP _IOW('E', 0x03, unsigned int[2])
43#define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2])
44#define EVIOCGKEYCODE_V2 _IOR('E', 0x04, struct input_keymap_entry)
45#define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2])
46#define EVIOCSKEYCODE_V2 _IOW('E', 0x04, struct input_keymap_entry)
47#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len)
48#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len)
49#define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len)
50#define EVIOCGPROP(len) _IOC(_IOC_READ, 'E', 0x09, len)
52#define EV_VERSION 0x010001
56#define BUS_BLUETOOTH 0x05
57#define BUS_VIRTUAL 0x06
61#define EV_SYN VSF_INPUT_TYPE_SYNC
62#define EV_KEY VSF_INPUT_TYPE_KEYBOARD
72#define EV_FF_STATUS 0x19
74#define EV_CNT (EV_MAX + 1)
78#define SYN_MT_REPORT 2
81#define SYN_CNT (SYN_MAX + 1)
90#define KEY_RESERVED VSF_KB_UNKNOWN
91#define KEY_ESC VSF_KB_ESCAPE
100#define KEY_9 VSF_KB_9
101#define KEY_0 VSF_KB_0
102#define KEY_A VSF_KB_a
103#define KEY_B VSF_KB_b
104#define KEY_C VSF_KB_c
105#define KEY_D VSF_KB_d
106#define KEY_E VSF_KB_e
107#define KEY_F VSF_KB_f
108#define KEY_G VSF_KB_g
109#define KEY_H VSF_KB_h
110#define KEY_I VSF_KB_i
111#define KEY_J VSF_KB_j
112#define KEY_K VSF_KB_k
113#define KEY_L VSF_KB_l
114#define KEY_M VSF_KB_m
115#define KEY_N VSF_KB_n
116#define KEY_O VSF_KB_o
117#define KEY_P VSF_KB_p
118#define KEY_Q VSF_KB_q
119#define KEY_R VSF_KB_r
120#define KEY_S VSF_KB_s
121#define KEY_T VSF_KB_t
122#define KEY_U VSF_KB_u
123#define KEY_V VSF_KB_v
124#define KEY_W VSF_KB_w
125#define KEY_X VSF_KB_x
126#define KEY_Y VSF_KB_y
127#define KEY_Z VSF_KB_z
128#define KEY_MINUS VSF_KB_MINUS
129#define KEY_EQUAL VSF_KB_EQUAL
130#define KEY_BACKSPACE VSF_KB_BACKSPACE
131#define KEY_TAB VSF_KB_TAB
132#define KEY_LEFTBRACE VSF_KB_LEFT_BRACE
133#define KEY_RIGHTBRACE VSF_KB_RIGHT_BRACE
134#define KEY_ENTER VSF_KB_ENTER
135#define KEY_SEMICOLON VSF_KB_SEMICOLON
136#define KEY_APOSTROPHE VSF_KB_SINGLE_QUOTE
137#define KEY_GRAVE VSF_KB_GRAVE
138#define KEY_BACKSLASH VSF_KB_BACKSLASH
139#define KEY_COMMA VSF_KB_COMMA
140#define KEY_DOT VSF_KB_DOT
141#define KEY_SLASH VSF_KB_SLASH
142#define KEY_SPACE VSF_KB_SPACE
143#define KEY_CAPSLOCK VSF_KB_CAPSLOCK
144#define KEY_NUMLOCK VSF_KP_NUMLOCK
145#define KEY_F1 VSF_KB_F1
146#define KEY_F2 VSF_KB_F2
147#define KEY_F3 VSF_KB_F3
148#define KEY_F4 VSF_KB_F4
149#define KEY_F5 VSF_KB_F5
150#define KEY_F6 VSF_KB_F6
151#define KEY_F7 VSF_KB_F7
152#define KEY_F8 VSF_KB_F8
153#define KEY_F9 VSF_KB_F9
154#define KEY_F10 VSF_KB_F10
155#define KEY_F11 VSF_KB_F11
156#define KEY_F12 VSF_KB_F12
157#define KEY_F13 VSF_KB_F13
158#define KEY_F14 VSF_KB_F14
159#define KEY_F15 VSF_KB_F15
160#define KEY_F16 VSF_KB_F16
161#define KEY_F17 VSF_KB_F17
162#define KEY_F18 VSF_KB_F18
163#define KEY_F19 VSF_KB_F19
164#define KEY_F20 VSF_KB_F20
165#define KEY_F21 VSF_KB_F21
166#define KEY_F22 VSF_KB_F22
167#define KEY_F23 VSF_KB_F23
168#define KEY_F24 VSF_KB_F24
169#define KEY_LEFTCTRL VSF_KB_LCTRL
170#define KEY_LEFTSHIFT VSF_KB_LSHIFT
171#define KEY_LEFTALT VSF_KB_LALT
172#define KEY_LEFTMETA VSF_KB_LGUI
173#define KEY_RIGHTCTRL VSF_KB_RCTRL
174#define KEY_RIGHTSHIFT VSF_KB_RSHIFT
175#define KEY_RIGHTALT VSF_KB_RALT
176#define KEY_RIGHTMETA VSF_KB_RGUI
177#define KEY_HOME VSF_KB_HOME
178#define KEY_UP VSF_KB_UP
179#define KEY_DOWN VSF_KB_DOWN
180#define KEY_LEFT VSF_KB_LEFT
181#define KEY_RIGHT VSF_KB_RIGHT
182#define KEY_PAGEUP VSF_KB_PAGE_UP
183#define KEY_PAGEDOWN VSF_KB_PAGE_DOWN
184#define KEY_INSERT VSF_KB_INSERT
185#define KEY_DELETE VSF_KB_DELETE
186#define KEY_END VSF_KB_END
187#define KEY_MUTE VSF_KB_MUTE
188#define KEY_VOLUMEUP VSF_KB_VOLUMEUP
189#define KEY_VOLUMEDOWN VSF_KB_VOLUMEDOWN
190#define KEY_POWER VSF_KB_POWER
191#define KEY_PAUSE VSF_KB_PAUSE
192#define KEY_STOP VSF_KB_STOP
193#define KEY_AGAIN VSF_KB_AGAIN
194#define KEY_UNDO VSF_KB_UNDO
195#define KEY_COPY VSF_KB_COPY
196#define KEY_PASTE VSF_KB_PASTE
197#define KEY_CUT VSF_KB_CUT
198#define KEY_FIND VSF_KB_FIND
199#define KEY_HELP VSF_KB_HELP
200#define KEY_MENU VSF_KB_MENU
201#define KEY_SLEEP VSF_KB_SLEEP
203#define KEY_KP1 VSF_KP_1
204#define KEY_KP2 VSF_KP_2
205#define KEY_KP3 VSF_KP_3
206#define KEY_KP4 VSF_KP_4
207#define KEY_KP5 VSF_KP_5
208#define KEY_KP6 VSF_KP_6
209#define KEY_KP7 VSF_KP_7
210#define KEY_KP8 VSF_KP_8
211#define KEY_KP9 VSF_KP_9
212#define KEY_KP0 VSF_KP_0
213#define KEY_KPASTERISK VSF_KP_ASTERISK
214#define KEY_KPMINUS VSF_KP_MINUS
215#define KEY_KPPLUS VSF_KP_PLUS
216#define KEY_KPDOT VSF_KP_DOT
217#define KEY_KPEQUAL VSF_KP_EQUAL
218#define KEY_KPCOMMA VSF_KP_COMMA
220#define KEY_RECORD (VSF_KB_USER + 1)
221#define KEY_SETUP (VSF_KB_USER + 2)
222#define KEY_REWIND (VSF_KB_USER + 3)
223#define KEY_PLAYPAUSE (VSF_KB_USER + 4)
224#define KEY_PLAY (VSF_KB_USER + 5)
225#define KEY_FASTFORWARD (VSF_KB_USER + 6)
226#define KEY_CANCEL (VSF_KB_USER + 7)
227#define KEY_SELECT (VSF_KB_USER + 8)
228#define KEY_CLEAR (VSF_KB_USER + 9)
229#define KEY_EXIT (VSF_KB_USER + 10)
230#define KEY_INFO (VSF_KB_USER + 11)
231#define KEY_PROGRAM (VSF_KB_USER + 12)
232#define KEY_CALENDAR (VSF_KB_USER + 13)
233#define KEY_RED (VSF_KB_USER + 14)
234#define KEY_GREEN (VSF_KB_USER + 15)
235#define KEY_YELLOW (VSF_KB_USER + 16)
236#define KEY_BLUE (VSF_KB_USER + 17)
237#define KEY_CHANNELUP (VSF_KB_USER + 18)
238#define KEY_CHANNELDOWN (VSF_KB_USER + 19)
241#define KEY_CNT (KEY_MAX + 1)
251#define REL_HWHEEL 0x06
253#define REL_WHEEL 0x08
257#define REL_CNT (REL_MAX + 1)
262#define BTN_SOUTH GAMEPAD_ID_R_DOWN
263#define BTN_A BTN_SOUTH
264#define BTN_EAST GAMEPAD_ID_R_RIGHT
265#define BTN_B BTN_EAST
266#define BTN_NORTH GAMEPAD_ID_R_UP
267#define BTN_X BTN_NORTH
268#define BTN_WEST GAMEPAD_ID_R_LEFT
269#define BTN_Y BTN_WEST
270#define BTN_TL GAMEPAD_ID_LT
271#define BTN_TR GAMEPAD_ID_RT
272#define BTN_SELECT GAMEPAD_ID_MENU_LEFT
273#define BTN_MODE GAMEPAD_ID_MENU_MAIN
274#define BTN_START GAMEPAD_ID_MENU_RIGHT
275#define BTN_THUMBL (GAMEPAD_ID_USER + 0)
276#define BTN_THUMBR (GAMEPAD_ID_USER + 1)
277#define BTN_TRIGGER_HAPPY (GAMEPAD_ID_USER + 2)
278#define BTN_TRIGGER_HAPPY1 (GAMEPAD_ID_USER + 2)
279#define BTN_TRIGGER_HAPPY2 (GAMEPAD_ID_USER + 3)
280#define BTN_TRIGGER_HAPPY3 (GAMEPAD_ID_USER + 4)
281#define BTN_TRIGGER_HAPPY4 (GAMEPAD_ID_USER + 5)
282#define BTN_TRIGGER_HAPPY5 (GAMEPAD_ID_USER + 6)
283#define BTN_TRIGGER_HAPPY6 (GAMEPAD_ID_USER + 7)
284#define BTN_TRIGGER_HAPPY7 (GAMEPAD_ID_USER + 8)
285#define BTN_TRIGGER_HAPPY8 (GAMEPAD_ID_USER + 9)
286#define BTN_TRIGGER_HAPPY9 (GAMEPAD_ID_USER + 10)
287#define BTN_TRIGGER_HAPPY10 (GAMEPAD_ID_USER + 11)
289#define BTN_MOUSE 0x410
290#define BTN_LEFT (BTN_MOUSE + VSF_INPUT_MOUSE_BUTTON_LEFT)
291#define BTN_RIGHT (BTN_MOUSE + VSF_INPUT_MOUSE_BUTTON_RIGHT)
292#define BTN_MIDDLE (BTN_MOUSE + VSF_INPUT_MOUSE_BUTTON_MIDDLE)
294#define BTN_JOYSTICK 0x420
295#define BTN_TRIGGER BTN_JOYSTICK
297#define BTN_DIGI 0x440
298#define BTN_TOOL_PEN 0x440
299#define BTN_TOOL_FINGER 0x445
300#define BTN_TOUCH 0x44a
301#define BTN_STYLUS 0x44b
311#define ABS_THROTTLE 0x06
312#define ABS_RUDDER 0x07
313#define ABS_WHEEL 0x08
315#define ABS_BRAKE 0x0a
316#define ABS_HAT0X 0x10
317#define ABS_HAT0Y 0x11
318#define ABS_HAT1X 0x12
319#define ABS_HAT1Y 0x13
320#define ABS_HAT2X 0x14
321#define ABS_HAT2Y 0x15
322#define ABS_HAT3X 0x16
323#define ABS_HAT3Y 0x17
324#define ABS_PRESSURE 0x18
325#define ABS_DISTANCE 0x19
326#define ABS_TILT_X 0x1a
327#define ABS_TILT_Y 0x1b
328#define ABS_TOOL_WIDTH 0x1c
329#define ABS_VOLUME 0x20
333#define ABS_CNT (ABS_MAX + 1)
338#define LED_CAPSL 0x01
339#define LED_SCROLLL 0x02
340#define LED_COMPOSE 0x03
342#define LED_SLEEP 0x05
343#define LED_SUSPEND 0x06
347#define LED_CHARGING 0x0a
349#define LED_CNT (LED_MAX + 1)
353#define MSC_SERIAL 0x00
354#define MSC_PULSELED 0x01
355#define MSC_GESTURE 0x02
358#define MSC_TIMESTAMP 0x05
360#define MSC_CNT (MSC_MAX + 1)
373#define input_event_sec time.tv_sec
374#define input_event_usec time.tv_usec
396#define to_input_dev(__dev) vsf_container_of((__dev), struct input_dev, dev)
483#define FF_RUMBLE 0x50
484#define FF_PERIODIC 0x51
485#define FF_CONSTANT 0x52
486#define FF_SPRING 0x53
487#define FF_FRICTION 0x54
488#define FF_DAMPER 0x55
489#define FF_INERTIA 0x56
491#define FF_EFFECT_MIN FF_RUMBLE
492#define FF_EFFECT_MAX FF_RAMP
494#define FF_SQUARE 0x58
495#define FF_TRIANGLE 0x59
497#define FF_SAW_UP 0x5b
498#define FF_SAW_DOWN 0x5c
499#define FF_CUSTOM 0x5d
500#define FF_WAVEFORM_MIN FF_SQUARE
501#define FF_WAVEFORM_MAX FF_CUSTOM
504#define FF_AUTOCENTER 0x61
506#define FF_MAX_EFFECTS FF_GAIN
508#define FF_CNT (FF_MAX + 1)
527static inline void input_put_device(
struct input_dev *
dev)
534static inline void * input_get_drvdata(
struct input_dev *
dev)
536 return dev_get_drvdata(&
dev->dev);
541 dev_set_drvdata(&
dev->dev,
data);
550static inline void input_report_key(
struct input_dev *
dev,
unsigned int code,
int value)
555static inline void input_report_rel(
struct input_dev *
dev,
unsigned int code,
int value)
560static inline void input_report_abs(
struct input_dev *
dev,
unsigned int code,
int value)
565static inline void input_report_ff_status(
struct input_dev *
dev,
unsigned int code,
int value)
570static inline void input_report_switch(
struct input_dev *
dev,
unsigned int code,
int value)
struct ieee80211_ext_chansw_ie data
Definition ieee80211.h:80
int32_t __s32
Definition types.h:54
uint32_t __u32
Definition types.h:55
int16_t __s16
Definition types.h:52
uint16_t __u16
Definition types.h:53
#define NULL
Definition lvgl.h:26
unsigned short uint16_t
Definition lvgl.h:41
signed int int32_t
Definition lvgl.h:44
#define min(x, y)
Definition minmax.h:11
#define max(x, y)
Definition minmax.h:12
void put_device(struct device *dev)
Definition vsf_linux_core.c:527
struct device * get_device(struct device *dev)
Definition vsf_linux_core.c:519
__u16 left_saturation
Definition input.h:448
__s16 center
Definition input.h:452
__u16 deadband
Definition input.h:451
__u16 right_saturation
Definition input.h:447
__s16 right_coeff
Definition input.h:449
__s16 left_coeff
Definition input.h:450
struct ff_envelope envelope
Definition input.h:439
__s16 level
Definition input.h:438
__u16 type
Definition input.h:469
__s16 id
Definition input.h:470
__u16 direction
Definition input.h:471
struct ff_trigger trigger
Definition input.h:472
struct ff_replay replay
Definition input.h:473
__u16 fade_level
Definition input.h:435
__u16 attack_level
Definition input.h:433
__u16 attack_length
Definition input.h:432
__u16 fade_length
Definition input.h:434
__s16 * custom_data
Definition input.h:462
__s16 offset
Definition input.h:458
__u32 custom_len
Definition input.h:461
struct ff_envelope envelope
Definition input.h:460
__u16 waveform
Definition input.h:455
__u16 phase
Definition input.h:459
__s16 magnitude
Definition input.h:457
__u16 period
Definition input.h:456
__s16 end_level
Definition input.h:443
__s16 start_level
Definition input.h:442
struct ff_envelope envelope
Definition input.h:444
__u16 length
Definition input.h:424
__u16 delay
Definition input.h:425
__u16 weak_magnitude
Definition input.h:466
__u16 strong_magnitude
Definition input.h:465
__u16 interval
Definition input.h:429
__u16 button
Definition input.h:428
vk_av_control_value_t value
Definition vsf_audio.h:171
vk_av_control_type_t type
Definition vsf_audio.h:170