The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Printing key
Tyzor


Joined: 12 Oct 2014
Posts: 10
Is there a particular way to print the actual letter that is printed instead of the value? At the moment i'm using e.key.keysym.sym to print out the key which results in the key code being printed.
Re: Printing key
Alex


Joined: 19 Sep 2014
Posts: 35
Tyzor wrote:
Is there a particular way to print the actual letter that is printed instead of the value? At the moment i'm using e.key.keysym.sym to print out the key which results in the key code being printed.

Try to use SDL_TextInputEvent and e.text.text. It works good for me.
With e.key.keysym.sym you can print ascii character too, but only characters entered without SHIFT key. Any non-latin unicode characters you can print only with SDL_TextInputEvent.
Tyzor


Joined: 12 Oct 2014
Posts: 10
Sweeet. Thanks!