Re: [hatari-devel] SDL GUI keyboard shortcuts

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Am Sun, 17 Aug 2014 11:46:24 +0300
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:

> > With SDL2, compiling now does not work anymore:
> ...
> > Could you please fix this?
> 
> I did a blind fix.  As I don't have SDL2 setup
> (I'm on Debian stable, and SDL2 comes only in testing),
> you need to test it and do any additional fixes.

Unfortunately, your fix does not work yet. 
.... And after looking at this for a while, I think there is also no
really easy solution here: SDL2 changed the keyboard handling interface
quite a bit, and now distinguishes properly between single keystrokes
and real text input (see https://wiki.libsdl.org/MigrationGuide#Input).

That means you have to parse SDL_TEXTINPUT events instead of
SDL_KEYDOWN events to get the value of composed keystrokes. But I don't
think that we want to use SDL_TEXTINPUT events for the normal dialog
shortcuts, because this is really rather meant for "real" text input,
e.g. it can also pop up a so-called IME window on certain systems.
Additionally, using SDL_TEXTINPUT events here would also break the way
we share SDL events between sdlgui.c and dlgFileSelect.c, i.e. the
fileselector could not use the page-up and -down keyevents that easily
anymore.

So I think it's better to stay with simple symbolic keys for the
shortcuts instead. IMHO we also do not need a shortcut for each and
every dialog item, many of them are rarely selected (e.g. the "show
hidden files" in the file selector), so they could easily be left
without a shortcut instead. (And adding a "(+)" there just for the
shortcut also looks quite ugly)

 Thomas



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/