Skip to content

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