Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2008

    Canvas and Canvas.FIRE

    In my game code which extends Canvas I have the code

    if(getGameAction(keyCode) == Canvas.FIRE)
    do stuff

    which funnily does not work since I stopped using FullCanvas and change to Canvas, if I change back to FullCanvas it works again... how does one fix something like this?

    Thanks in advance

  2. #2
    Nokia Developer Champion
    Join Date
    Apr 2003
    USA, CA

    Re: Canvas and Canvas.FIRE

    From the MIDP spec

    It is also possible for the user to issue commands when a canvas is current. Commands are mapped to keys and menus in a device-specific fashion. For some devices the keys used for commands may overlap with the keys that will deliver key code events to the canvas. If this is the case, the device will provide a means transparent to the application that enables the user to select a mode that determines whether these keys will deliver commands or key code events to the application. When the Canvas is in normal mode (see below), the set of key code events available to a canvas will not change depending upon the number of commands present or the presence of a command listener. When the Canvas is in full-screen mode, if there is no command listener present, the device may choose to deliver key code events for keys that would otherwise be reserved for delivery of commands. Game developers should be aware that access to commands will vary greatly across devices, and that requiring the user to issue commands during game play may have a great impact on the ease with which the game can be played.
    Does this explain your issue, or is it something else?


  3. #3
    Registered User
    Join Date
    Mar 2008

    Re: Canvas and Canvas.FIRE

    Yep that answers it thanks. Im a noob so I didnt know this would happen. Thanks for replying!

Similar Threads

  1. Problem with keyPressed in Canvas
    By jy820314 in forum Mobile Java General
    Replies: 3
    Last Post: 2011-12-20, 05:38

Posting Permissions

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