Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block until ready for writing #9

Open
multimeric opened this issue Sep 22, 2019 · 0 comments
Open

Block until ready for writing #9

multimeric opened this issue Sep 22, 2019 · 0 comments

Comments

@multimeric
Copy link

Further to discussion here: tuomasjjrasanen/python-uinput#6 (comment), we have noticed that attempting to use suinput_create, and then immediately suinput_emit will not work, likely because suinput_create isn't blocking until it's ready. It returns immediately.

Might this be because we're opening the uinput device with O_NONBLOCK? Alternatively, I notice in the uinput kernel examples, they also use a sleep(1), but say that "This pause is only needed in our example code". Any idea how we can have libsuinput do this for us?

/*
* 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. This pause is only needed in our example code!
*/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant