SDL_GetNamedKeymap()?

Is there any objection to adding an SDL_GetNamedKeysym() function to
SDL12 that would perform the inverse of SDL_GetKeyName()?

This would be useful when reading key binding config files – it
allows developers to use the SDL keynames.

Currently, applications can get similar functionality by extracting
all the names from SDL_GetKeyName() in a loop and then doing the
reverse mapping themselves, but that’s a bit of a hack…–
Best of luck,
Mark Schreiber
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20041007/bccdfc3f/attachment.pgp

Is there any objection to adding an SDL_GetNamedKeysym() function to
SDL12 that would perform the inverse of SDL_GetKeyName()?

For SDL 1.3 I would like to change the way SDL keysyms are handled.
Most keyboards have keys that map to the latin-1 printable range,
without using keyboard modifiers. These keys will simply be named
using the latin-1 character they generate unshifted. e.g. the # key
on french keyboards would simply be named “#”. Non-printable keys
like shift or print-screen will have the same names that they did
before, and would have keysyms in the range > 255.

And to answer your question, yes, adding SDL_GetNamedKeysym() would
be fine. :slight_smile:

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment