| Summary: | SDL_GameControllerEventWatcher: Log on event with value >= k_nMaxReverseEntries | ||
|---|---|---|---|
| Product: | SDL | Reporter: | ny00 |
| Component: | joystick | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: | A patch adding out-of-bound logs | ||
|
Description
ny00
2016-10-02 14:14:51 UTC
Thanks! I switched it to SDL_SetError(), so programs don't output unexpected text https://hg.libsdl.org/SDL/rev/f732781d7ddc Thanks for updating the repository!
I should first mention, that it looks like I've forgotten to add a similar function call for the hats.
Secondly, I thought that it makes more sense to output a message even while not under debug mode, as I believe is currently done with this function call from src/video/x11/SDL_x11events.c:
fprintf(stderr,
"The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL mailing list <sdl@libsdl.org> X11 KeyCode %d (%d), X11 KeySym 0x%lX (%s).\n",
keycode, keycode - min_keycode, keysym,
X11_XKeysymToString(keysym));
I guess it is a bad idea to spam a lot of messages like this for a lot of events involving an out-of-bound joystick axis index.
Maybe functions like SDL_PrivateGameControllerParseButton should do the logging, instead? (It also uses SDL_SetError currently.)
I'm going to leave it as-is for now, thanks! |