Join Today
+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Jan 2008
    Location
    Romania
    Posts
    788

    Default SDL SoftKeyboard Class

    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:
    > 16 Oct 2010 > v0.1 Alpha 2
    - 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
    > 15 Oct 2010 > v0.1 Alpha 1
    - 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
    > 13 Oct 2010 > v0.1.0 Pre-Alpha
    - 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
    Screenshots:
    Attached Thumbnails Attached Thumbnails SDL SoftKeyboard Class-screenshot-testing-app-v0.1-alpha2.png   SDL SoftKeyboard Class-screenshot-testing-app-v0.1-alpha2-1.png  
    Attached Files Attached Files
    Last edited by BruceLee; 10-24-2010 at 11:05 AM.

  2. #2

    Default

    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


  3. #3
    Join Date
    Aug 2008
    Location
    Etawah the city of grt. DACOITS
    Posts
    4,897

    Default

    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

    http://www.motorolafans.com/forums/signaturepics/sigpic64563_36.gif
    "GONE FOREVER TO MAKE A COME BACK"

  4. #4
    Join Date
    Jan 2008
    Location
    Romania
    Posts
    788

    Default

    UPDATE > 13 Oct 2010 > v0.1.0 Pre-Alpha

    Check the first post

  5. #5

    Default

    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


  6. #6
    Join Date
    Jan 2008
    Location
    Romania
    Posts
    788

    Default

    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.

  7. #7

    Default

    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


  8. #8
    Join Date
    Jan 2008
    Location
    Romania
    Posts
    788

    Default

    I've just uploaded the alpha2 version which is more of an eye-candy update

  9. #9

    Default

    Quote Originally Posted by BruceLee View Post
    I've just uploaded the alpha2 version which is more of an eye-candy update
    Checking ... I hope next version would be even better with much updates...

    Thanks..

    BUG FOUND : the test box comes only when we press "R" in keyboard in x86

    testing on EZX
    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


  10. #10
    Join Date
    Jan 2008
    Location
    Romania
    Posts
    788

    Default

    Quote Originally Posted by kundancool View Post
    Checking ... I hope next version would be even better with much updates...

    Thanks..

    BUG FOUND : the test box comes only when we press "R" in keyboard in x86

    testing on EZX
    you still don't get it here'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.


 
+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. How to get out of a boring class - FUNNY!
    By Konig in forum -The Lounge-
    Replies: 6
    Last Post: 07-08-2009, 06:05 AM
  2. E8 - A class of it's own!
    By rokitrokr in forum Motorola E8
    Replies: 3
    Last Post: 01-20-2009, 05:08 PM
  3. SDL compiled. Can't run SDL apps
    By riteshtonk in forum Development
    Replies: 6
    Last Post: 11-21-2007, 03:06 PM
  4. installing .class files
    By aditya584 in forum A1200 General Chat
    Replies: 2
    Last Post: 06-16-2007, 07:14 PM
  5. canvasplus.class
    By plvt_florian in forum E680i General Chat
    Replies: 0
    Last Post: 12-31-2006, 09:03 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Single Sign On provided by vBSSO

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1