I had the joy of changing my application to use UNICODE translations today,
giving users the ability to get symbols using the shift keys and, even
better, actually lets me use my correct keymap instead of just getting
However, I noticed a few minor problems.
The manual page for SDL_EnableUNICODE says…
“to enable UNICODE… (enable=0)”
… which is clearly incorrect.
The manual page doesn’t bother to mention that -1 can be passed to
get the current state without changing anything - I had to look at the
header to discover this, which isn’t something I’d normally do. It
also neglects to mention how to turn translation back off.
It’s entertaining that SDL_GetKeyName() receives an SDLKey and has a
table of translations that include symbols, but the only way to get
most symbols (properly) is through UNICODE - but the ‘unicode’ field
is a Uint16, not an SDLKey.
Given the above, the keyname table is missing some entries. Most
noticeably ‘%’ has been omitted, but worse so have all upper case
letters. This essentially means that SDL_GetKeyName() can’t be used
with UNICODE, although I guess no-one does anyway.
It’d be nice to not have to both use the ‘unicode’ and ‘keysym’ fields
when a call to SDL_GetKeyName() could do the job.
- Deth -