[Scummvm-devel] Simplifying keyboard repeat
Torbjörn Andersson
eriktorbjorn at telia.com
Mon Sep 25 07:32:07 CEST 2006
Max Horn wrote:
>> So, the natural way to handle this is to use the native keyboard
>> repeat when available, and to emulate it otherwise. To this end, we
>> could either add a kFeatureKeyboardRepeat flag. Or, we could
>> *require* backends to implement/emulate keyboard repeat, but
>> provide the code required for that. Maybe it would even be possible
>> to add the code require for that directly into OSystem, thus
>> letting porters implement this with a minimal amount of work.
So what you're saying is that a backend could either implement repeating
by native methods - e.g. calling SDL_EnableKeyRepeat() in the SDL
backend - or there would be code in OSystem to automagically generate
"fake" keyboard events as a fallback?
I.e. there would be a pollEvent() in OSystem that would only check for
"fake" events. The individual backends would still define pollEvent() to
call the original one, before doing their own stuff. On key down/up
events, they could optionally call functions i OSystem to set up/cancel
the generation of "fake" keyboard repeat events.
Torbjörn
More information about the Scummvm-devel
mailing list