×

Discussion Board

Results 1 to 6 of 6

Thread: Key management

  1. #1
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    50

    Key management

    Hi,
    in my application I am using the class Canvas with the method public final void keyPressed(int i1) and CommandListener.
    My application can be navigating the joistick and I implemented Canvas.UP, Canvas.DOWN and Canvas.FIRE, but on some phones (expecially the ones without OS) when the commandListener is implemented the FIRE button doesn't work and I need to use KEY_NUM5 button.
    this is a wrong issue, I think. In this way user get confused, even more, I guess it's not ok that my FIRE button stop working.
    May this be caused by a conflict between keyPressed and CommandListener?
    chia_84

  2. #2
    Nokia Developer Champion
    Join Date
    Sep 2007
    Posts
    915

    Re: Key management

    Quote Originally Posted by chia_84 View Post
    Hi,
    in my application I am using the class Canvas with the method public final void keyPressed(int i1) and CommandListener.
    My application can be navigating the joistick and I implemented Canvas.UP, Canvas.DOWN and Canvas.FIRE, but on some phones (expecially the ones without OS) when the commandListener is implemented the FIRE button doesn't work and I need to use KEY_NUM5 button.
    this is a wrong issue, I think. In this way user get confused, even more, I guess it's not ok that my FIRE button stop working.
    May this be caused by a conflict between keyPressed and CommandListener?
    chia_84

    Why do not you use just 5 insted of Canvas.FIRE. It will not create any confusion.

  3. #3
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    50

    Re: Key management

    Because all other functions are performed with the joistick and I do not see why I should use KEY_NUM5 button as FIRE as it is not intuitive to the user.

    chia_84

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: Key management

    Hi,
    That should not be happen,
    Are you getting the correct code for that key.
    With which device you are working with,
    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  5. #5
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    50

    Re: Key management

    I get the correct code would not otherwise explain why in other classes where I implement Canvas.FIRE without CommandListener works

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Key management

    This is to be expected.

    I recommend that you do not use getGameAction(). It does tend to give inconsistent results. No rule says that dpad-centre has be "FIRE".

    Behaviour (and even keycode) of keys other than 0-9, * and # can vary between different canvas types (Canvas, Canvas (FullScreenMode) and Nokia FullCanvas). Behaviour can also vary when Command objects or a CommandListener are bound to the Canvas.

    You will have confusing results across different devices, if you mix keyPressed() and commandAction(), when you are using a key that can produce both events (even if no Command is bound to that key).

    Cheers,
    Graham.

Similar Threads

  1. Replies: 8
    Last Post: 2009-01-24, 06:00
  2. List of Codes for Buttons
    By skela in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2008-05-20, 20:39
  3. Replies: 0
    Last Post: 2003-11-14, 07:58
  4. Key Event Issues
    By mykes in forum Symbian
    Replies: 0
    Last Post: 2003-05-01, 10:55
  5. keybindings nokia7650 and nokia6310i
    By topisystems in forum Mobile Java General
    Replies: 1
    Last Post: 2002-06-05, 14:25

Posting Permissions

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