[SDL] unicode & SDL_GetKeyState
koshmaar at poczta.onet.pl
Sun Feb 13 14:51:42 PST 2005
> I have the unfortunate task of reinventing the wheel to make an edit box
> in my GUI system.
> I've been using SDL_GetKeyState to update my keyboard state info.
> I am reluctant to switch to using the event system.
> Is there some way that I can obtain the unicode character of a key (if
> any) when I have the SDLK_ value returned by SDL_GetKeyState?
Some time ago I've encountered almost identical problem (SDL_GetKeyState, how to get uppercase keycodes for GUI edit etc.), I've also asked for help on this list and response I got, was simple: switch to events. I've started arguing, there was good discussion about pros and cons of events, SDL_GetKeyState() etc., and eventually, at the end, I said "thx guys, it looks like events are really the only way to go", opened IDE and started changing code.
Since then, my new input code has been working _almost_ flawlessly; if you want, I can send you code or give some tips how to write it from scratch. But now, I have only one, probably sad, advice for you: your only hope is switching to events...
P.S. ok, ok, but if you have much free time, you can alwyas try hacking things with SDL_GetKeyState, and if you succeed - remember to write about it on this list, I'm sure everyone would be happy to see that there's other solution.
More information about the SDL