Skip to content

Repeat all pending events, to prevent axis sticking #3

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

StelardActek
Copy link

I found this issue when testing some code derived from yours. It would be really easy to get the axes on the virtual device to stick by rapidly releasing the real pedals. By looping until all pending events are read, the issue goes away.

@sambazley
Copy link
Owner

Thanks for this. I think it would be tidier to put the libevdev_next_event call in the while condition. It also looks like LIBEVDEV_READ_FLAG_NORMALshould be included in the flags.

while (libevdev_next_event(real, LIBEVDEV_READ_FLAG_NORMAL | LIBEVDEV_READ_FLAG_BLOCKING, &ev) == 0) {
	write(uifd, &ev, sizeof(ev));
}

I'm currently unable to test if this but I've pushed the commit to https://github.com/sambazley/virtjs/tree/StelardActek-master

@StelardActek
Copy link
Author

Agreed, that is much neater.

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

Successfully merging this pull request may close these issues.

2 participants