×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    6

    Determining when FIRE is assigned a soft menu

    While recently testing a game I've written on the Series 40 3rd Edition emulator, I noticed that the emulator assigns the same key used in GameCanvas.FIRE_PRESSED to a soft menu. This is a serious problem for me, as I have a soft menu but also use the FIRE key for other purposes. I could work around it by disabling the FIRE key, if I could discover that the FIRE key is assigned to a soft menu item. Any good way of doing that?

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280

    Re: Determining when FIRE is assigned a soft menu

    It relies on the Nokia UI classes, but:
    Code:
    if (getKeyCode(FIRE) == FullCanvas.KEY_SOFTKEY1) // or KEY_SOFTKEY2 or 3
    A small problem is that getKeyCode() will only return one out of possibly many options for the FIRE game action, but that would also mean the user has another way of triggering that event (like pressing 5 instead of the middle softkey). You'd have to decide if that's acceptable.

    I have a 6280 and I've noticed quite a few games that have that problem, and you have to use 5 to fire.

    shmoove

  3. #3
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,699

    Re: Determining when FIRE is assigned a soft menu

    hi shmoove,

    that probably would not help, at least while testing on emulator high-level menu command always override FIRE button and if cdsmith has menus items their listener will be fired
    @cdsmith
    can you simply use full screen canvas without any labels for menu or add one or two labels (positive/negative) and trap key events for negative values? that way FIRE could be still used,

    regards,
    Peter

  4. #4
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280

    Re: Determining when FIRE is assigned a soft menu

    Quote Originally Posted by peterblazejewicz
    that probably would not help, at least while testing on emulator high-level menu command always override FIRE button and if cdsmith has menus items their listener will be fired
    That code isn't something to put in keyPressed() to check if FIRE is pressed. It's something to put in the initialization of the class, to discover if a softkey could override the FIRE key, and take appropiate measures accordingly. So I don't see how Commands overriding the FIRE button would affect it. Am I missing something?

    shmoove

  5. #5
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,699

    Re: Determining when FIRE is assigned a soft menu

    hi shmoove,

    oh, ok, bear with me - i'm learning,
    so it also should be possible (to detect S40 platform) to use unique property:
    Code:
    public static boolean IS_S40;
        public TestMidlet(){
            IS_S40 = (getAppProperty("com.nokia.mid.timeformat") != null);
        }
    I guess,
    however both does not work in my S40 emulator and I don't own S40 device yet for tests,

    regards,
    Peter

Similar Threads

  1. How to desactivate the Menu Key ?...
    By GeKI in forum Symbian User Interface
    Replies: 3
    Last Post: 2007-10-22, 10:02
  2. the way Nokia Series 40 handles predefined soft menu in WML cards
    By jevgen in forum Mobile Web Site Development
    Replies: 0
    Last Post: 2005-10-17, 09:39
  3. CBA, menu and key events
    By joker_pl in forum Symbian User Interface
    Replies: 1
    Last Post: 2005-09-19, 10:27
  4. Menu bar in FEP
    By kdinn in forum Symbian C++
    Replies: 0
    Last Post: 2004-05-27, 08:07
  5. Menu Select button using List object
    By abstractworlds in forum Mobile Java General
    Replies: 4
    Last Post: 2002-12-09, 13:08

Posting Permissions

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