[maemo-developers] [maemo-developers] to Nokia: simple method to gain a gaming audience on 770/800

From: klaus at rotters.de klaus at rotters.de
Date: Fri Jan 26 18:01:45 EET 2007
Kees Jongenburger wrote:
> I have been asking
> around but did not find a simple pluggable virtual keyboard for sdl.

This is IMHO a very simple problem. Just a quick guess: You have to draw a nice keyboard, 
export it to BMP and load it with SDL_LoadBMP(). Then you display (blit) it with 
SDL_BlitSurface(). Don't forget to update the screen with SDL_UpdateRects(). Then you can 
SDL_WaitEvent() to wait for SDL_MOUSEBUTTONDOWN events. You just need a table 
which contains the x and y coords of our virtual keyboard to decode coords to the key 
pressed. Of course you should handle shift, delete and something else. The decoded char 
can now be displayed, you probably need some kind of "displaying a text"-function (sfont.c) 
for it. And so on. This all can be packed in a function like "char *SDL_EnterText()".

An other problem would be to incoperate such a virtual SDL keyboard to the large number of 
different SDL-GUI toolkits.

For the most number of action games, you don't need to enter text during  game play. Its 
enough if you do this on startup, and therefor you can use a Maemo startup window.

 Klaus Rotter * klaus <at> rotters <dot> de * www.rotters.de

More information about the maemo-developers mailing list