| Summary: | Some joystick inputs are delayed on FreeBSD | ||
|---|---|---|---|
| Product: | SDL | Reporter: | kikuchan |
| Component: | joystick | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 1.2 | ||
| Hardware: | All | ||
| OS: | FreeBSD | ||
| Attachments: | A patch to read() multiple times | ||
Fixed, thanks! http://hg.libsdl.org/SDL/rev/957d7137867c |
Created attachment 1322 [details] A patch to read() multiple times Some joysticks with high sampling rate need to be read() more fast, otherwise it delay user inputs due to internal queue. Especially, an app that issues SDL_PollEvent() not so frequent, such as: while ( ! done ) { usleep(10*1000); // <-- some delay while ( SDL_PollEvent(&event) ) { : } } It is solved by read()-ing multiple times at once. (I think this is safe because of O_NONBLOCK mode)