×

Discussion Board

Results 1 to 8 of 8

Hybrid View

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    1

    J2ME MIDP2 soft buttons

    Is there any way to actually get control over the soft buttons? Adding commands into a menu is definitely not enough, as the phone adds it's own Exit button, thus making it impossible to just simply set the soft buttons to OK and Cancel for example.

    In full screen canvas the soft buttons work even more weird: with single command it is nicely assigned to one of the soft buttons, but with two commands I get a menu of those two commands behind BOTH of the soft buttons. Plus that always so annoying compulsory Exit command.

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    Use a full screen canvas. Don't add Commands. Instead, draw your own labels in the appropiate location (the bottom corners of the screen), and handle them in the keyPressed() method by catching the FullCanvas.KEY_SOFTKEY1 and FullCanvas.KEY_SOFTKEY2 keys. This will work on any Nokia handset.

    For other handsets you will probably need to catch different keycodes for the softbuttons (there's no other way than to make specific versions for every manufacturer/device class). Some phones won't raise a keyPressed() event for the soft buttons, and in this case you will have to use Commands (although I've seen on more than one ocassion games that use the * and # keys instead, just make sure you label the buttons so the user knows what key to use).

    shmoove

  3. #3
    Registered User
    Join Date
    Apr 2005
    Posts
    24

    Question Re: J2ME MIDP2 soft buttons

    Hello shmoove,

    Quote Originally Posted by shmoove
    For other handsets you will probably need to catch different keycodes for the softbuttons (there's no other way than to make specific versions for every manufacturer/device class). Some phones won't raise a keyPressed() event for the soft buttons, and in this case you will have to use Commands (although I've seen on more than one ocassion games that use the * and # keys instead, just make sure you label the buttons so the user knows what key to use).
    shmoove
    Do you know whether there's somewhere a list of devices that do not generate a keyPressed() event for the soft keys? ... And whether there's somewhere info about different manufacturers' selections for keycodes of the soft keys. Someone said in a different thread that Sony-Ericsson uses the same keycodes as Nokia.

    Br,
    Jibbox

  4. #4
    Regular Contributor
    Join Date
    Jan 2004
    Posts
    82

    Re: J2ME MIDP2 soft buttons

    Someone said in a different thread that Sony-Ericsson uses the same keycodes as Nokia.
    I think thats me you mean...

    But now I have something to add.
    Yesterday I tested one app on my new 6230i. It uses the mentioned keycodes I used succesfull on Nokia and Sony Ericsson devices. It didn' work.
    Because I don't use the FullCanvas I cannot use i.e. FullCanvas.KEY_SOFTKEY2...

    So I took my little testapp which prints the keyCodes (retrieved through keyPressed()) on the screen. But when I pressed one of the softkeys nothing happend (on 6230i). On other devices it worked.

  5. #5
    Registered User
    Join Date
    Apr 2005
    Posts
    24

    Re: J2ME MIDP2 soft buttons

    Hello Leicester22,

    Quote Originally Posted by Leicester22
    I think thats me you mean...

    So I took my little testapp which prints the keyCodes (retrieved through keyPressed()) on the screen. But when I pressed one of the softkeys nothing happend (on 6230i). On other devices it worked.
    Outch! Which one of the softkeys it was? [the one that didn't give the keycode]

    BTW: I foud this table on the keycodes on different devices:
    http://www.j2medeveloper.com/wiki/Wi...anvas.keycodes

    I don't know whether the info is accurate, but I suppose it is...

    - Jibbox

  6. #6
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: J2ME MIDP2 soft buttons

    thanks for the link, it helps, and if can add these precisions:
    sagem devices supports some keys, with codes inverted (-7 and -6) considering nokia and SE
    also these (the sagem) do not support keyReleased event on softkeys (but support it on any other key ...)

  7. #7
    Registered User
    Join Date
    Sep 2008
    Posts
    3

    Re: J2ME MIDP2 soft buttons

    but exist some keys as fire & soft kesy when we pressed it not used keypressed

  8. #8
    (Retired) Nokia Developer Admin.
    Join Date
    Jan 2006
    Location
    Michigan
    Posts
    4,664

    Re: J2ME MIDP2 soft buttons

    Quote Originally Posted by hazemmatooq View Post
    but exist some keys as fire & soft kesy when we pressed it not used keypressed

    Please create a new thread that describes your problem do not hijack a 3 year old message that just confuses people.

    Thanks,

    Ron

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×