You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int fd = open("/dev/uinput", O_WRONLY | O_NONBLOCK);
......
ioctl(fd, UI_DEV_CREATE);
/*
* On UI_DEV_CREATE the kernel will create the device node for this
* device. We are inserting a pause here so that userspace has time
* to detect, initialize the new device, and can start listening to
* the event, otherwise it will not notice the event we are about
* to send.
*/
//sleep(1);
write(...); // not work, if not sleep(1)
int fd = open("/dev/uinput", O_WRONLY | O_NONBLOCK);
......
ioctl(fd, UI_DEV_CREATE);
/*
* On UI_DEV_CREATE the kernel will create the device node for this
* device. We are inserting a pause here so that userspace has time
* to detect, initialize the new device, and can start listening to
* the event, otherwise it will not notice the event we are about
* to send.
*/
//sleep(1);
write(...); // not work, if not sleep(1)
https://kernel.org/doc/html/v4.12/input/uinput.html#examples
The text was updated successfully, but these errors were encountered: