Good Work ... and keep us informed about it
SDL-SK (SDL-SoftKeyboard)
Current state: Alpha 2
Hi.
Since some of the sdl games that we port could use some keyboard input (for example the name of a savegame) i thought of making a soft-keyboard class easy to implement.
For the moment the attached image is just an edited image to show how it should look in the end.
After implementing most of my ideeas and getting the project to a decent level I'll write a short tutorial for including SK in your SDL source.
Further updates will be posted here.
DETAILS:
SEAMLESS mode = Sends keyboard events to SDL and those are processed by the host application (which in this case only sends output to terminal). It's assumed that the host application knows how to process the key presses.
SEPARATED mode = Pauses the host app and gets a string without sending any key events. If it's called with SK::GetString(char str[]); the str variable will contain the input text.
Each has advantages and disadvantages. For example SEAMLESS is dependent on the host framerate and it works only if fullscreen blits are runned.
While SEPARATED can only get you a string but it's host independent so to say.
I'd say that SK is quite flexible as the binaries present in the alpha2 release are compiled with SDL_image but it can also be compiled without it. Of course it will result in a lack of graphical details such as shadows or transparency but it will work. Also the font is not true type font so it doesn't need SDL_ttf. It's using a slightly modified SFont class which keeps the font in an image.
UPDATES:
Screenshots:> 16 Oct 2010 > v0.1 Alpha 2
> 15 Oct 2010 > v0.1 Alpha 1- Too many changes to remember (again) but here are some important things:
- added animation when showing/hiding SK
- added background transparency
- Separated mode now has transparent background when compiled wihtout SDL_image
- demo application controls:
. . . to open Seamless mode press space / Call
. . . to open Separated mode press R / ButtonUnderCall
- got it implemented in fheroes2
- uploaded new screenshots
> 13 Oct 2010 > v0.1.0 Pre-Alpha- Too many changes to remember all
- This builded binaries of this example are a demo of the 'Separated' mode
- The code is quite a mess right now but I've uploaded anyway since I've said I will
- Changed status from "Early ideea" to "Pre-Alpha".
- Uploaded 0.1.0pre-alpha version compiled for x86 and ezx (the archive contains absolutely everything I used to make this. Even the images from which I've built the keyboard theme.)
. . . Press Space[PC] or Call[Phone] to Show/Hide the keyboard (Opens the 'seamless' mode. A 'separated' mode will come.)
. . . Run through terminal/telnet so you can see what's happening
Last edited by BruceLee; 10-24-2010 at 11:05 AM.
Good Work ... and keep us informed about it
Motorola A1200 : Beast
Motorola MOTOROKR E6/E6e : GoldenBird/Bricked
Samsung Galaxy Y S5360 : Stock ROM (Gingerbread 2.3.6) - ROOTED
Keep up the good work brother
LG OPTIMUS 2X : MY INDROID EVOLUTION RC3
SAMSUNG GALAXY SL : MY ANDROID EVOLUTION
HTC ELFIN : MY DARIUS 6.5 ROM
SONY ERICSSON X10 MINI : MINI EVOLUTION
"GONE FOREVER TO MAKE A COME BACK"
UPDATE > 13 Oct 2010 > v0.1.0 Pre-Alpha
Check the first post![]()
nice update...
you are working really hard on this..
Motorola A1200 : Beast
Motorola MOTOROKR E6/E6e : GoldenBird/Bricked
Samsung Galaxy Y S5360 : Stock ROM (Gingerbread 2.3.6) - ROOTED
tonight will come the alpha version... and maybe you'll see it implemented in an actual game
EDIT: I'm sorry but it seems that I didn't get to do what I wanted.. Some lack of time and a bit tired.. But since I've told you that I'll post an update I've uploaded the current version although it's not at all ready.
Last edited by BruceLee; 10-14-2010 at 09:54 PM.
which game you are going to implement this alpha release...?
Motorola A1200 : Beast
Motorola MOTOROKR E6/E6e : GoldenBird/Bricked
Samsung Galaxy Y S5360 : Stock ROM (Gingerbread 2.3.6) - ROOTED
I've just uploaded the alpha2 version which is more of an eye-candy update
Last edited by kundancool; 10-16-2010 at 02:55 AM.
Motorola A1200 : Beast
Motorola MOTOROKR E6/E6e : GoldenBird/Bricked
Samsung Galaxy Y S5360 : Stock ROM (Gingerbread 2.3.6) - ROOTED
you still don't get ithere's a brief explanation which might clear things up
SEAMLESS mode = Sends keyboard events to SDL and those are processed by the host application (which in this case only sends output to terminal). So there is no need for any text box. It's assumed that the host application has it implemented.
SEPARATED mode = Pauses the host app and gets a string without sending any key events. If it's called with SK::GetString(char str[]); the str variable will contain the input text.
Each has advantages and disadvantages. For example SEAMLESS is dependent on the host framerate and it works only if fullscreen blits are runned.
While SEPARATED can only get you a string but it's host independent so to say.
I'd say that SK is quite flexible as the binaries present in the alpha2 release are compiled with SDL_image but it can also be compiled without it. Of course it will result in a lack of graphical details such as shadows or transparency but it will work. Also the font is not true type font so it doesn't need SDL_ttf. It's using a slightly modified SFont class which keeps the font in an image.
Last edited by BruceLee; 10-16-2010 at 03:14 AM.