Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User Arnau.Manyosa's Avatar
    Join Date
    Oct 2007
    Posts
    11
    I've made an application that uses FIRE key and works perfect with WTK emulator, but does absolutly nothing when I try with n96. I print on canvas the variable captured with getGameAction(keyCode) and I get nothing. The rest of the keys (UP,DOWN,etc) works fine with WTK and n96.

    Even I tried with n77 and other non-nokia mobiles and it works. There's any bug with n96 FIRE key?

    Thanks in advance for your time!

  2. #2
    Super Contributor grahamhughes's Avatar
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,394
    I'd recommend against using getGameAction(), as it does have a tendancy to give inconsistent results. There is no rule that says any specific key has to map to "FIRE". Do you get "FIRE" from any key ("5", dpad-centre, left-soft, send, etc.)?

    Are you receiving a keyPressed() event at all?

    On some devices, availability of key events (and indeed the key codes themselves) may vary between Canvas, Canvas (FullScreenMode) and FullCanvas (in the case of a Nokia). Where keys that can bind to Commands are concerned (LSK, RSK, dpad-centre), functionality may vary when Command objects (or a CommandListener) are attached to the Canvas.

    Cheers,
    Graham.

  3. #3
    Nokia Developer Champion raj_J2ME's Avatar
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,314
    Hi,
    Graham is correct,
    You can test that whether on the key pressed you can get any code or not...if yes then you can use likes -
    if(keyCode == -5)
    {
    // do something..


    }
    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  4. #4
    Registered User hazemmatooq's Avatar
    Join Date
    Sep 2008
    Posts
    3
    I search about solve for this problem from 5 days
    but no way
    I want from Nokia support solve our problems

  5. #5
    Super Contributor grahamhughes's Avatar
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,394
    What's your problem, hazemmatooq?

  6. #6
    Registered User Arnau.Manyosa's Avatar
    Join Date
    Oct 2007
    Posts
    11
    Thanks on the advice not to use getGameAction(). It's better to use the keyCode directly.

    But the problem is the same: with n96 I don't receive any keyPressed event with dpad-centre button, and with n77 works perfectly.

    I think it's a kind of bug... no other had the same problem?

  7. #7
    Super Contributor grahamhughes's Avatar
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,394
    Try switching from Canvas to Nokia FullCanvas.

  8. #8
    Registered User Arnau.Manyosa's Avatar
    Join Date
    Oct 2007
    Posts
    11
    I've found that dpad-center button only works if you are in FullScreenMode... ^_^

    Thanks for your comments!

  9. #9
    (Retired) Nokia Developer Admin. Nokia Ron's Avatar
    Join Date
    Jan 2006
    Location
    Michigan
    Posts
    4,664
    Quote Originally Posted by hazemmatooq View Post
    I search about solve for this problem from 5 days
    but no way
    I want from Nokia support solve our problems

    Please open a NEW thread in the appropriate language area and include all relevant information such as SDK version and so on. Your posts are impossible to understand and we are unable to help.

    Ron

  10. #10
    Super Contributor grahamhughes's Avatar
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,394
    Hi Ron,

    hazemmatooq's problem appears to be the one in this thread... softkeys and dpad centre not giving keyPressed() events.

    Not all keys give keyPressed() events. If you want portable code, you can rely only on 0-9, * and #.

    The particular case here is that keys that can bind to Command objects do not produce keyPressed() events.

    Solution: use FullCanvas, or setFullScreenMode(true)

    FullCanvas defines codes for these keys. Use the constant, and don't put "-5" in your code.

  11. #11
    Nokia Developer Champion raj_J2ME's Avatar
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,314
    Hi,
    A nice discussion so far..
    Guy's what I would say is that hazemmatooq can use the GameCamnvas..and then can check that whether the same issue persists or not...
    Then hazemmatooq you can use like


    if((GameCanavs.FIRE_PRESSED) != 0))
    {

    }

    You can read more about game canvas in java docs ...of WTK..
    This is just for the testing purposes..
    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. List of Codes for Buttons
    By skela in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2008-05-20, 20:39
  2. Fire key on touch screen device?
    By girdhar in forum Mobile Java General
    Replies: 1
    Last Post: 2008-03-25, 09:44
  3. problem facing with capture key on standby screen
    By mayudada in forum Symbian C++
    Replies: 2
    Last Post: 2008-01-15, 11:53
  4. camera shutter key problem with focus key
    By s4028469 in forum Symbian C++
    Replies: 5
    Last Post: 2007-11-04, 23:21

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved