Re: [hatari-devel] SDL GUI keyboard shortcuts

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


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.

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


> 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.

I already added them for everything (except to arrows
used for specifying screen sizes).


> (And adding a "(+)" there just for the shortcut also looks quite ugly)

I'm not against removing that, but IMHO not having shortcut
is also a bit funny if everything else has it.  Do others
have opinions on this?


Btw. There are few dialog items with numbers (e.g. in sound dialog Hz
selection) where shortcut key is specified, but not indicated.  This
is because text in item didn't have any numbers that wouldn't overlap
with shortcuts in other items.  I think those shortcuts are still
(at least to an extent) discoverable, because shortcuts for them are
numbers, similarly to rest of items in that same radiobutton group.


	- Eero



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