This is a kind of reminder.
(On Android)

Source code.

linux/input.h
    struct input_event;
: write 'struct input_event' to input event node.
ex.
    struct input_event ev;
    ...
    write(fd, &ev, sizeof(ev));
    ...

File system

/dev/input/*, /proc/bus/input/*

Touch event 
 

   type  code  value
<common> EV_ABS
EV_ABS
ABS_X
ABS_Y 
<value>
<value> 
Press (or Drag)Release EV_KEY
EV_KEY
BTN_TOUCH
BTN_TOUCH
1
0
<common>  EV_SYN 0 0

Key event

  type code value
Press EV_KEY <key code> 1
Release EV_KEY <key code> 0

Done. 

+ Recent posts