[Scummvm-devel] Simplifying keyboard repeat

Max Horn max at quendi.de
Fri May 19 03:51:25 CEST 2006


Am 19.05.2006 um 12:15 schrieb Marcus Comstedt:

> Max Horn <max at quendi.de> writes:
>
>> Now, the other topic Marcus brought up are keyboard shortcuts. Well,
>> I am not convinced that "sharing" code there is that useful. I just
>> wrote a looong three paragraphs about it, but now decided to delete
>> them, and instead ask this: Marcus, could you give a list of all
>> hotkeys that you think should be shared, and state which ports would
>> share them? So far, after looking through all backends, the only
>> example I could come up with what precisely yours: Ctrl-A seems
>> useful for both SDL and DC (and *maybe* PalmOS).
>
> I will give you such a list in the form of set comprehension:
>
> L = { key | key is presented to the user as available by
>             platform independent code }
>
> :-)
>
> The SCUMM help text for example lists Ctrl 0-9, Alt 0-9, Alt x, Ctrl
> z, Alt Enter, Ctrl d, Ctrl s, Ctrl f, Ctrl g, Ctrl m, Ctrl Alt 1-8,
> Ctrl Alt +, Ctrl Alt - and Ctrl a.  Yet only a few of these are
> implemented by the SCUMM engine itself.

You are mixing engine specific hotkeys with backend specific hotkeys.  
I assume you are aware of that, but just use this as a rhetoric tool  
to drive home some kind of point... ? Maybe to underline that our  
docs suck (in which case I'd wholeheartedly agree) ?

>   In some cases it might of
> course make more sense to adjust L by removing the documentation when
> it is not applicable.

Sure. The "documentation" is in a quit sorry state, and everybody is  
welcome to improve it. E.g. by adding to section 5.4 "Hot Keys" a  
remark that clarifies that those hotkeys all apply to the default SDL  
backend, and to ports with keyboards. And may be totally inapplicable  
for other ports. You are most welcome to do just that :-).


>
>> Convince me that adding a whole generic hotkey sharing infrastructure
>> would save us more work than adding three lines to the DC backend to
>> implement Ctrl-A, and we can discuss it for real :-).
>
> Well, if Ctrl a is implemented by the engine(s), that's fine too.
> You could add the three lines there, and no new infrastructure is
> needed.

You mean adding those three lines to a couple dozen event loops  
spread over 11 engines, vs. adding it only in the DC backend (and  
maybe the X11 backend, should it ever implement aspect ration  
correction) ? Somehow I fail to see how this is "better" in about any  
regard... :-)

>   This would also allow different engines to use different
> hotkeys, to avoid collisions with keys the game might use.

So far we had a consensus that it's better to be as consistent as  
possible with regards to hotkeys. I'd rather force an engine to  
change it's ctrl-a hotkey to something else than to force the user to  
remember the hotkey for "toggle aspect ratio" for a dozen engines/ 
games separately...




Cheers,
Max




More information about the Scummvm-devel mailing list