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
Highlighted
Developer
Posts: 23
Registered: ‎08-06-2008
My Device: Not Specified

STATUS_KEY_HELD_WHILE_ROLLING

Hi,

 

I was playing with the PhoneEventListener the other day and noticed interesting feature I have no explanation so far. If anybody ever heard or has a guess, please give it away.

 

Models affected are curves (833x, various providers, OS 4.5)

 

-So there is an incoming call.

-From within the incomingCall() you send two events that correspond to END CALL key (key down and then key up)

-Creating events with the status of 5000.

 

Here is the relevant snippet of code:

========================

 

                    ev = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEvent.KEY_DOWN, ((char) Keypad.KEY_END),
                        5000);
                    EventInjector.invokeEvent(ev);
                    ev = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEvent.KEY_UP, ((char) Keypad.KEY_END),
                        5000);
                    EventInjector.invokeEvent(ev);

 ev = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEvent.KEY_DOWN, ((char) Keypad.KEY_END), 5000);

 EventInjector.invokeEvent(ev);

 ev = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEvent.KEY_UP, ((char) Keypad.KEY_END), 5000);

 EventInjector.invokeEvent(ev);

 

========================

 

and this sequence is wrapped inside new Thread(){...}.start();

 

Among the existing (documented) statuses from KeypadListener there is only one that fits inside this magic number:

STATUS_KEY_HELD_WHILE_ROLLING = 8

 

The behavior of these keystrokes differ dramatically from the same keystrokes if you use 0 instead of 5000 in such a way that - incoming call does not get through at all. If you pass 0, the phone call prompt screen pops up and phone rings.

 

So what is this magic status number 5000 or STATUS_KEY_HELD_WHILE_ROLLING that makes this dramatic difference ?

 

Thanks,

Nikolay