Re: [hatari-devel] SDL GUI keyboard shortcuts

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


Am Sun, 17 Aug 2014 20:09:32 +0300
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:

> Hi,
> 
> On sunnuntai 17 elokuu 2014, Thomas Huth wrote:
> > ... 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.
> 
> There are few very useful use-cases for non-alphanumeric
> shortcut keys:
> - List arrows, e.g. in joystick & fsel dialogs.
>   I've mapped them to < and >.
> - Frequently used buttons on top of the file selector,
>   mapped to '.', '$', '~', '/'.
> 
> Of these symbols, I think '.' doesn't need Shift on all/most
> keyboards, but others do.  I guess the Fsel buttons could instead
> of symbols use _UP, _CWD, _HOME and _ROOT text/shortcuts, but that
> would conflict with letter shortcuts for jumping to corresponding
> place in file list.

After all, maybe it's either not so important to have shortcuts for the
buttons on top of the file selector ... or maybe we should just not
implement the letter-shortcuts to jump to the corresponding places in
the file list.

> Some options:
> - document that SDL2 builds support only alphanumeric shortcuts
> - add code to skip indicator drawing for such shortcuts with SDL2

That sounds like a bad idea ... SDL2 will be the only option one day,
so we should go for a solution that works with both versions of the SDL
library now.

 Thomas



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