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_SCROLLLOCK VSF_KB_SCROLLLOCK
146#define KEY_F1 VSF_KB_F1
147#define KEY_F2 VSF_KB_F2
148#define KEY_F3 VSF_KB_F3
149#define KEY_F4 VSF_KB_F4
150#define KEY_F5 VSF_KB_F5
151#define KEY_F6 VSF_KB_F6
152#define KEY_F7 VSF_KB_F7
153#define KEY_F8 VSF_KB_F8
154#define KEY_F9 VSF_KB_F9
155#define KEY_F10 VSF_KB_F10
156#define KEY_F11 VSF_KB_F11
157#define KEY_F12 VSF_KB_F12
158#define KEY_F13 VSF_KB_F13
159#define KEY_F14 VSF_KB_F14
160#define KEY_F15 VSF_KB_F15
161#define KEY_F16 VSF_KB_F16
162#define KEY_F17 VSF_KB_F17
163#define KEY_F18 VSF_KB_F18
164#define KEY_F19 VSF_KB_F19
165#define KEY_F20 VSF_KB_F20
166#define KEY_F21 VSF_KB_F21
167#define KEY_F22 VSF_KB_F22
168#define KEY_F23 VSF_KB_F23
169#define KEY_F24 VSF_KB_F24
170#define KEY_LEFTCTRL VSF_KB_LCTRL
171#define KEY_LEFTSHIFT VSF_KB_LSHIFT
172#define KEY_LEFTALT VSF_KB_LALT
173#define KEY_LEFTMETA VSF_KB_LGUI
174#define KEY_RIGHTCTRL VSF_KB_RCTRL
175#define KEY_RIGHTSHIFT VSF_KB_RSHIFT
176#define KEY_RIGHTALT VSF_KB_RALT
177#define KEY_RIGHTMETA VSF_KB_RGUI
178#define KEY_HOME VSF_KB_HOME
179#define KEY_UP VSF_KB_UP
180#define KEY_DOWN VSF_KB_DOWN
181#define KEY_LEFT VSF_KB_LEFT
182#define KEY_RIGHT VSF_KB_RIGHT
183#define KEY_PAGEUP VSF_KB_PAGE_UP
184#define KEY_PAGEDOWN VSF_KB_PAGE_DOWN
185#define KEY_INSERT VSF_KB_INSERT
186#define KEY_DELETE VSF_KB_DELETE
187#define KEY_END VSF_KB_END
188#define KEY_MUTE VSF_KB_MUTE
189#define KEY_VOLUMEUP VSF_KB_VOLUMEUP
190#define KEY_VOLUMEDOWN VSF_KB_VOLUMEDOWN
191#define KEY_POWER VSF_KB_POWER
192#define KEY_PAUSE VSF_KB_PAUSE
193#define KEY_STOP VSF_KB_STOP
194#define KEY_AGAIN VSF_KB_AGAIN
195#define KEY_UNDO VSF_KB_UNDO
196#define KEY_COPY VSF_KB_COPY
197#define KEY_PASTE VSF_KB_PASTE
198#define KEY_CUT VSF_KB_CUT
199#define KEY_FIND VSF_KB_FIND
200#define KEY_HELP VSF_KB_HELP
201#define KEY_MENU VSF_KB_MENU
202#define KEY_SLEEP VSF_KB_SLEEP
204#define KEY_KP1 VSF_KP_1
205#define KEY_KP2 VSF_KP_2
206#define KEY_KP3 VSF_KP_3
207#define KEY_KP4 VSF_KP_4
208#define KEY_KP5 VSF_KP_5
209#define KEY_KP6 VSF_KP_6
210#define KEY_KP7 VSF_KP_7
211#define KEY_KP8 VSF_KP_8
212#define KEY_KP9 VSF_KP_9
213#define KEY_KP0 VSF_KP_0
214#define KEY_KPASTERISK VSF_KP_ASTERISK
215#define KEY_KPMINUS VSF_KP_MINUS
216#define KEY_KPPLUS VSF_KP_PLUS
217#define KEY_KPDOT VSF_KP_DOT
218#define KEY_KPEQUAL VSF_KP_EQUAL
219#define KEY_KPCOMMA VSF_KP_COMMA
220#define KEY_KPENTER VSF_KP_ENTER
221#define KEY_KPSLASH VSF_KP_SLASH
223#define KEY_RECORD (VSF_KB_USER + 1)
224#define KEY_SETUP (VSF_KB_USER + 2)
225#define KEY_REWIND (VSF_KB_USER + 3)
226#define KEY_PLAYPAUSE (VSF_KB_USER + 4)
227#define KEY_PLAY (VSF_KB_USER + 5)
228#define KEY_FASTFORWARD (VSF_KB_USER + 6)
229#define KEY_CANCEL (VSF_KB_USER + 7)
230#define KEY_SELECT (VSF_KB_USER + 8)
231#define KEY_CLEAR (VSF_KB_USER + 9)
232#define KEY_EXIT (VSF_KB_USER + 10)
233#define KEY_INFO (VSF_KB_USER + 11)
234#define KEY_PROGRAM (VSF_KB_USER + 12)
235#define KEY_CALENDAR (VSF_KB_USER + 13)
236#define KEY_RED (VSF_KB_USER + 14)
237#define KEY_GREEN (VSF_KB_USER + 15)
238#define KEY_YELLOW (VSF_KB_USER + 16)
239#define KEY_BLUE (VSF_KB_USER + 17)
240#define KEY_CHANNELUP (VSF_KB_USER + 18)
241#define KEY_CHANNELDOWN (VSF_KB_USER + 19)
245#define BTN_MISC (VSF_KB_USER + 0x20)
246#define BTN_0 (BTN_MISC + 0)
247#define BTN_1 (BTN_MISC + 1)
248#define BTN_2 (BTN_MISC + 2)
249#define BTN_3 (BTN_MISC + 3)
250#define BTN_4 (BTN_MISC + 4)
251#define BTN_5 (BTN_MISC + 5)
252#define BTN_6 (BTN_MISC + 6)
253#define BTN_7 (BTN_MISC + 7)
254#define BTN_8 (BTN_MISC + 8)
255#define BTN_9 (BTN_MISC + 9)
257#define BTN_GAMEPAD (BTN_MISC + 0x10)
258#define BTN_DPAD_UP (BTN_GAMEPAD | GAMEPAD_ID_L_UP)
259#define BTN_DPAD_DOWN (BTN_GAMEPAD | GAMEPAD_ID_L_DOWN)
260#define BTN_DPAD_LEFT (BTN_GAMEPAD | GAMEPAD_ID_L_LEFT)
261#define BTN_DPAD_RIGHT (BTN_GAMEPAD | GAMEPAD_ID_L_RIGHT)
262#define BTN_SOUTH (BTN_GAMEPAD | GAMEPAD_ID_R_DOWN)
263#define BTN_A BTN_SOUTH
264#define BTN_EAST (BTN_GAMEPAD | GAMEPAD_ID_R_RIGHT)
265#define BTN_B BTN_EAST
266#define BTN_NORTH (BTN_GAMEPAD | GAMEPAD_ID_R_UP)
267#define BTN_X BTN_NORTH
268#define BTN_WEST (BTN_GAMEPAD | GAMEPAD_ID_R_LEFT)
269#define BTN_Y BTN_WEST
270#define BTN_TL (BTN_GAMEPAD | GAMEPAD_ID_LB)
271#define BTN_TR (BTN_GAMEPAD | GAMEPAD_ID_RB)
272#define BTN_TL2 (BTN_GAMEPAD | GAMEPAD_ID_LT)
273#define BTN_TR2 (BTN_GAMEPAD | GAMEPAD_ID_RT)
274#define BTN_SELECT (BTN_GAMEPAD | GAMEPAD_ID_MENU_LEFT)
275#define BTN_MODE (BTN_GAMEPAD | GAMEPAD_ID_MENU_MAIN)
276#define BTN_START (BTN_GAMEPAD | GAMEPAD_ID_MENU_RIGHT)
277#define BTN_THUMBL (BTN_GAMEPAD | GAMEPAD_ID_L_STICK)
278#define BTN_THUMBR (BTN_GAMEPAD | GAMEPAD_ID_R_STICK)
279#define BTN_TRIGGER_HAPPY (BTN_GAMEPAD | (GAMEPAD_ID_USER + 0))
280#define BTN_TRIGGER_HAPPY1 (BTN_GAMEPAD | (GAMEPAD_ID_USER + 0))
281#define BTN_TRIGGER_HAPPY2 (BTN_GAMEPAD | (GAMEPAD_ID_USER + 1))
282#define BTN_TRIGGER_HAPPY3 (BTN_GAMEPAD | (GAMEPAD_ID_USER + 2))
283#define BTN_TRIGGER_HAPPY4 (BTN_GAMEPAD | (GAMEPAD_ID_USER + 3))
284#define BTN_TRIGGER_HAPPY5 (BTN_GAMEPAD | (GAMEPAD_ID_USER + 4))
285#define BTN_TRIGGER_HAPPY6 (BTN_GAMEPAD | (GAMEPAD_ID_USER + 5))
286#define BTN_TRIGGER_HAPPY7 (BTN_GAMEPAD | (GAMEPAD_ID_USER + 6))
287#define BTN_TRIGGER_HAPPY8 (BTN_GAMEPAD | (GAMEPAD_ID_USER + 7))
288#define BTN_TRIGGER_HAPPY9 (BTN_GAMEPAD | (GAMEPAD_ID_USER + 8))
289#define BTN_TRIGGER_HAPPY10 (BTN_GAMEPAD | (GAMEPAD_ID_USER + 9))
290#define BTN_GAMEPAD_MAX BTN_TRIGGER_HAPPY10
292#define BTN_MOUSE (BTN_GAMEPAD + 0x10)
293#define BTN_LEFT (BTN_MOUSE + VSF_INPUT_MOUSE_BUTTON_LEFT)
294#define BTN_RIGHT (BTN_MOUSE + VSF_INPUT_MOUSE_BUTTON_RIGHT)
295#define BTN_MIDDLE (BTN_MOUSE + VSF_INPUT_MOUSE_BUTTON_MIDDLE)
296#define BTN_MOUSE_MAX (BTN_MOUSE + 2)
298#define BTN_JOYSTICK (BTN_MOUSE + 3)
299#define BTN_TRIGGER (BTN_JOYSTICK + 0)
300#define BTN_THUMB (BTN_JOYSTICK + 1)
301#define BTN_THUMB2 (BTN_JOYSTICK + 2)
303#define __BTN_OTHER (BTN_JOYSTICK + 0x10)
304#define BTN_DIGI (__BTN_OTHER + 0)
305#define BTN_TOOL_PEN (__BTN_OTHER + 0)
306#define BTN_TOOL_FINGER (__BTN_OTHER + 5)
307#define BTN_TOUCH (__BTN_OTHER + 10)
308#define BTN_STYLUS (__BTN_OTHER + 11)
310#define KEY_OK (__BTN_OTHER + 12)
311#define KEY_ALS_TOGGLE (__BTN_OTHER + 13)
316#define KEY_CNT (KEY_MAX + 1)
326#define REL_HWHEEL 0x06
328#define REL_WHEEL 0x08
332#define REL_CNT (REL_MAX + 1)
342#define ABS_THROTTLE 0x06
343#define ABS_RUDDER 0x07
344#define ABS_WHEEL 0x08
346#define ABS_BRAKE 0x0a
347#define ABS_HAT0X 0x10
348#define ABS_HAT0Y 0x11
349#define ABS_HAT1X 0x12
350#define ABS_HAT1Y 0x13
351#define ABS_HAT2X 0x14
352#define ABS_HAT2Y 0x15
353#define ABS_HAT3X 0x16
354#define ABS_HAT3Y 0x17
355#define ABS_PRESSURE 0x18
356#define ABS_DISTANCE 0x19
357#define ABS_TILT_X 0x1a
358#define ABS_TILT_Y 0x1b
359#define ABS_TOOL_WIDTH 0x1c
360#define ABS_VOLUME 0x20
363#define ABS_MT_POSITION_X 0x35
364#define ABS_MT_POSITION_Y 0x36
365#define ABS_MT_TRACKING_ID 0x39
366#define ABS_MT_PRESSURE 0x3a
369#define ABS_CNT (ABS_MAX + 1)
374#define LED_CAPSL 0x01
375#define LED_SCROLLL 0x02
376#define LED_COMPOSE 0x03
378#define LED_SLEEP 0x05
379#define LED_SUSPEND 0x06
383#define LED_CHARGING 0x0a
385#define LED_CNT (LED_MAX + 1)
389#define MSC_SERIAL 0x00
390#define MSC_PULSELED 0x01
391#define MSC_GESTURE 0x02
394#define MSC_TIMESTAMP 0x05
396#define MSC_CNT (MSC_MAX + 1)
409#define input_event_sec time.tv_sec
410#define input_event_usec time.tv_usec
441#define to_input_dev(__dev) vsf_container_of((__dev), struct input_dev, dev)
528#define FF_RUMBLE 0x50
529#define FF_PERIODIC 0x51
530#define FF_CONSTANT 0x52
531#define FF_SPRING 0x53
532#define FF_FRICTION 0x54
533#define FF_DAMPER 0x55
534#define FF_INERTIA 0x56
536#define FF_EFFECT_MIN FF_RUMBLE
537#define FF_EFFECT_MAX FF_RAMP
539#define FF_SQUARE 0x58
540#define FF_TRIANGLE 0x59
542#define FF_SAW_UP 0x5b
543#define FF_SAW_DOWN 0x5c
544#define FF_CUSTOM 0x5d
545#define FF_WAVEFORM_MIN FF_SQUARE
546#define FF_WAVEFORM_MAX FF_CUSTOM
549#define FF_AUTOCENTER 0x61
551#define FF_MAX_EFFECTS FF_GAIN
553#define FF_CNT (FF_MAX + 1)
555extern int input_ff_create(
struct input_dev *dev,
unsigned int max_effects);
567static inline struct input_dev * input_get_device(
struct input_dev *dev)
572static inline void input_put_device(
struct input_dev *dev)
579static inline void * input_get_drvdata(
struct input_dev *dev)
581 return dev_get_drvdata(&dev->dev);
584static inline void input_set_drvdata(
struct input_dev *dev,
void *
data)
586 dev_set_drvdata(&dev->dev,
data);
595static inline void input_report_key(
struct input_dev *dev,
unsigned int code,
int value)
600static inline void input_report_rel(
struct input_dev *dev,
unsigned int code,
int value)
605static inline void input_report_abs(
struct input_dev *dev,
unsigned int code,
int value)
610static inline void input_report_ff_status(
struct input_dev *dev,
unsigned int code,
int value)
615static inline void input_report_switch(
struct input_dev *dev,
unsigned int code,
int value)
620static inline void input_sync(
struct input_dev *dev)
625static inline void input_mt_sync(
struct input_dev *dev)
634extern void input_copy_abs(
struct input_dev *dst,
unsigned int dst_axis,
const struct input_dev *src,
unsigned int src_axis);
#define VSF_STATIC_ASSERT(__COND,...)
Definition __type.h:199
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
#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:546
struct device * get_device(struct device *dev)
Definition vsf_linux_core.c:538
unsigned short uint16_t
Definition stdint.h:7
int int32_t
Definition stdint.h:8
unsigned long long uint64_t
Definition stdint.h:11
__u16 left_saturation
Definition input.h:493
__s16 center
Definition input.h:497
__u16 deadband
Definition input.h:496
__u16 right_saturation
Definition input.h:492
__s16 right_coeff
Definition input.h:494
__s16 left_coeff
Definition input.h:495
struct ff_envelope envelope
Definition input.h:484
__s16 level
Definition input.h:483
__u16 type
Definition input.h:514
__s16 id
Definition input.h:515
__u16 direction
Definition input.h:516
struct ff_trigger trigger
Definition input.h:517
struct ff_replay replay
Definition input.h:518
__u16 fade_level
Definition input.h:480
__u16 attack_level
Definition input.h:478
__u16 attack_length
Definition input.h:477
__u16 fade_length
Definition input.h:479
__s16 * custom_data
Definition input.h:507
__s16 offset
Definition input.h:503
__u32 custom_len
Definition input.h:506
struct ff_envelope envelope
Definition input.h:505
__u16 waveform
Definition input.h:500
__u16 phase
Definition input.h:504
__s16 magnitude
Definition input.h:502
__u16 period
Definition input.h:501
__s16 end_level
Definition input.h:488
__s16 start_level
Definition input.h:487
struct ff_envelope envelope
Definition input.h:489
__u16 length
Definition input.h:469
__u16 delay
Definition input.h:470
__u16 weak_magnitude
Definition input.h:511
__u16 strong_magnitude
Definition input.h:510
__u16 interval
Definition input.h:474
__u16 button
Definition input.h:473
vk_av_control_value_t value
Definition vsf_audio.h:171
vk_av_control_type_t type
Definition vsf_audio.h:170
#define dcl_vsf_bitmap(__name, __bit_size)
Definition vsf_bitmap.h:98
#define vsf_bitmap(__name)
Definition vsf_bitmap.h:93
vk_input_notifier_t notifier
Definition vsf_xboot.c:31