×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    21

    7210 Canvas (MIDP) up/down key

    Hi,

    I have a Canvas (MIDP) in my application with up/down arrow keys defined for it. It scrolls through the list with up/down keys on other (3650) phones.

    But, those key events are not captured for some reason. I have also defined '#' key event to reach the bottom of the list and that key event is captured. Only up/down arrow keys are not captured.

    However, it may sound weird. The up/down keys work normally on a Form (MIDP).

    -Nachiket

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    Are you using game actions?
    Code:
    protected void keyPressed(int keyCode) {
      int gameAction = getGameAction(keyCode);
      switch (gameAction) {
        case Canvas.UP:
          scrollUP();
          break;
        case Canvas.DOWN:
          scrollDown();
          break;
      }
    }
    That should map the key presses to the same buttons used for scrolling lists in Forms.

    shmoove

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    21
    Just for others' reference... I was using
    keyCode == getKeyCode(Canvas.UP) and keyCode == getKeyCode(Canvas.DOWN) instead of getGameAction().

    Weirdly, Nokia 7210 (and possibly Series 40) phones map KEY_NUM2 and KEY_NUM8 to key code.

Posting Permissions

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