Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Regular Contributor
Posts: 61
Registered: ‎03-28-2010
My Device: Bold 9700
My Carrier: Maxis Malaysia
Accepted Solution

What is scancode for keypad hangup?

I'm doing a reminder screen which will popup via pushscreen when triggered and play a media file. I don't have any problem to close the screen when user click on the 'close' button that I've created.

 

But when user, instead of click on 'close' button, he just click the red-hang-up button, the media wont stop. and the next triggered event, multiple screen will be pushed and played.

 

How can I detect the red-hang-up button so I can properly stop and close the media and screen?

Highlighted
Developer
Posts: 467
Registered: ‎07-16-2009
My Device: Z10 LE
My Carrier: Vodafone NL

Re: What is scancode for keypad hangup?

Try KeyPad.KEY_END constant.

Regular Contributor
Posts: 61
Registered: ‎03-28-2010
My Device: Bold 9700
My Carrier: Maxis Malaysia

Re: What is scancode for keypad hangup?

Tried that, it doesn't trigger.

Developer
Posts: 16,851
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: What is scancode for keypad hangup?

try 1179648 as a keycode in keydown

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Regular Contributor
Posts: 61
Registered: ‎03-28-2010
My Device: Bold 9700
My Carrier: Maxis Malaysia

Re: What is scancode for keypad hangup?

My bad actually. Here is the code. It works. I got from this forum by searching for KEY_END

 

 

   /**
     * Overridden to capture SEND and END keys
     * @param aKeyCode
     * @param aTime
     * @return
     */
    public boolean keyDown(int aKeyCode, int aTime)
    {
      if (Keypad.key(aKeyCode) == Keypad.KEY_SEND)
      {
        return true; // always consume SEND key
      }
      else if(Keypad.key(aKeyCode) == Keypad.KEY_END
        || Keypad.key(aKeyCode) == Keypad.KEY_ESCAPE)
      {
        // close screen or whatever
        //close();
        return true;  // consume
      }

      return super.keyDown(aKeyCode, aTime);
    }