Lines Matching +full:can +full:- +full:fd

10 process can create a virtual input device with specific capabilities. Once
11 this virtual device is created, the process can send events through it,
12 that will be delivered to userspace and in-kernel consumers.
28 create uinput devices and send events. libevdev is less error-prone than
38 ---------------
44 .. code-block:: c
48 void emit(int fd, int type, int code, int val)
59 write(fd, &ie, sizeof(ie));
66 int fd = open("/dev/uinput", O_WRONLY | O_NONBLOCK);
73 ioctl(fd, UI_SET_EVBIT, EV_KEY);
74 ioctl(fd, UI_SET_KEYBIT, KEY_SPACE);
82 ioctl(fd, UI_DEV_SETUP, &usetup);
83 ioctl(fd, UI_DEV_CREATE);
88 * to detect, initialize the new device, and can start listening to
95 emit(fd, EV_KEY, KEY_SPACE, 1);
96 emit(fd, EV_SYN, SYN_REPORT, 0);
97 emit(fd, EV_KEY, KEY_SPACE, 0);
98 emit(fd, EV_SYN, SYN_REPORT, 0);
106 ioctl(fd, UI_DEV_DESTROY);
107 close(fd);
113 ---------------
118 .. code-block:: c
129 int fd = open("/dev/uinput", O_WRONLY | O_NONBLOCK);
132 ioctl(fd, UI_SET_EVBIT, EV_KEY);
133 ioctl(fd, UI_SET_KEYBIT, BTN_LEFT);
135 ioctl(fd, UI_SET_EVBIT, EV_REL);
136 ioctl(fd, UI_SET_RELBIT, REL_X);
137 ioctl(fd, UI_SET_RELBIT, REL_Y);
145 ioctl(fd, UI_DEV_SETUP, &usetup);
146 ioctl(fd, UI_DEV_CREATE);
151 * to detect, initialize the new device, and can start listening to
158 while (i--) {
159 emit(fd, EV_REL, REL_X, 5);
160 emit(fd, EV_REL, REL_Y, 5);
161 emit(fd, EV_SYN, SYN_REPORT, 0);
171 ioctl(fd, UI_DEV_DESTROY);
172 close(fd);
179 --------------------
187 .. code-block:: c
196 int version, rc, fd;
198 fd = open("/dev/uinput", O_WRONLY | O_NONBLOCK);
199 rc = ioctl(fd, UI_GET_VERSION, &version);
210 ioctl(fd, UI_SET_EVBIT, EV_KEY);
211 ioctl(fd, UI_SET_KEYBIT, KEY_SPACE);
215 write(fd, &uud, sizeof(uud));
217 ioctl(fd, UI_DEV_CREATE);
222 * to detect, initialize the new device, and can start listening to
229 emit(fd, EV_KEY, KEY_SPACE, 1);
230 emit(fd, EV_SYN, SYN_REPORT, 0);
231 emit(fd, EV_KEY, KEY_SPACE, 0);
232 emit(fd, EV_SYN, SYN_REPORT, 0);
240 ioctl(fd, UI_DEV_DESTROY);
242 close(fd);