[SDL] Shifted keys, i.e. 'a' vs. 'A'
Mike Austin
mike_ekim at yahoo.com
Sun Mar 12 22:42:03 PST 2006
Joshua Oreman wrote:
> On 3/12/06, Mike Austin <mike_ekim at yahoo.com> wrote:
>> I'm writing a user interface in rubysdl, and things have been going along
>> pretty smoothly. I was wondering if there is a way to get the ASCII code of an
>> aggregate key event, for example shift+'a' to get 'A'. I know sdl is more for
>> raw input and game development, but is there a way to get this? I don't want
>> to keep track of the shift state if I can help it, because that opens up a new
>> can of worms with alphabetic and non-alphabetic shifted values.
>
> In C, it's
> SDL_EnableUNICODE (1); in your init stuff
> Then use the `unicode' field in the keysym.
> I don't know how that translates to ruby, but it should be helpful :-)
>
> -- Josh
That works, great! But I guess the number pad is a different issue, as it
doesn't produce unicode. Hmmm.
Mike
More information about the SDL
mailing list