input_event structure description (from linux/input.h)

眉间皱痕 提交于 2019-12-02 19:03:52
Nominal Animal

The struct input_event is, among others, defined in include/linux/input.h.


From 5. Event interface in Linux kernel Documentation/input/input.txt (and modified to provide the correct header file names):

  • time is the timestamp, it returns the time at which the event happened.

  • type is for example EV_REL for relative moment, EV_KEY for a keypress or release. More types are defined in include/linux/input-event-codes.h.

  • code is event code, for example REL_X or KEY_BACKSPACE, again a complete list is in include/linux/input-event-codes.h.

  • value is the value the event carries. Either a relative change for EV_REL, absolute new value for EV_ABS (joysticks ...), or 0 for EV_KEY for release, 1 for keypress and 2 for autorepeat.

For guides and example code, do a web search for "linux kernel" "input subsystem".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!