| Summary: | Repeat member to SDL_KeyboardEvent | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Edgar Simo <bobbens> |
| Component: | events | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | enhancement | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | All | ||
| OS: | All | ||
Sure, that sounds like a reasonable patch. Thanks! This is in the latest snapshot, thanks! |
Hello, I implemented double tapping using SDL_KeyboardEvents by detecting time between key presses and if under a threshold create a double tap event. Afterwards I decided to activate keyboard repeat for other reasons. However this broke the double tap event. Currently there's no way to detect if an SDL_KeyboardEvent is a repeat or not. I'd propose to add a single member to be able to detect that, something like: typedef struct{ Uint8 type; Uint8 state; SDL_keysym keysym; Uint8 repeat; /**< New repeat member. */ } SDL_KeyboardEvent; This would allow detection of repeats and handle them as needed if one wants to distinguish between repeats and actual presses like the case of double taps. It will be ABI compliant and won't alter backward compatibility, nor will it increase the size of the SDL_event union since there's larger structs (like mouse events for example). Overall it's a quite minor fix and not sure if anyone other then me might be interested in this. If I have time I'll see how hard it is to patch and attach a patch if possible. Edgar