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
Developer
myraddin
Posts: 412
Registered: ‎09-12-2008
My Device: 9000 9810

Re: Inter screen communication

Hmm.. yes, the approach is ok, but I cannot send the SEND (green) key.

 

Anyone had any experience with 

dispatchKeyEvent()  ?

 

I was able to find some information about it:

dispatchKeyEvent
public boolean dispatchKeyEvent(int event,
char key,
int keycode,
int time)
Description copied from class: Screen Dispatches a key event to the currently focussed field. Overrides: dispatchKeyEvent in class Screen Since: JDE 4.0.2

 

char cSend = Keypad.map(Keypad.KEY_SEND);
int iSend = Keypad.KEY_SEND; // 17

int iSend2 = 0x110000 // 17 * 10000

 

newCallScreen.dispatchKeyEvent(EventInjector.KeyCodeEvent.KEY_DOWN, cSend, iSend, aTime);
newCallScreen.dispatchKeyEvent(EventInjector.KeyCodeEvent.KEY_DOWN, cSend, iSend2, aTime);

 

The character code is '\u0000'  (and that's what I expected) but both calls don't do anything.

 

This gives me headaches :smileyhappy:

 

Also, how will I be able to 'simulate' - actually forward - the trackball movement ? 

 

 



"Listen carefully, I shall say this only once"
Developer
myraddin
Posts: 412
Registered: ‎09-12-2008
My Device: 9000 9810

Re: Inter screen communication

Still no luck with the SEND key.

 

Well, ok, I could live with that, but if the navigation also fails then I am stuck :smileysad:

 

This is the code I am trying to put to use (o why did they protect the key* methods :smileysad: ) :

 

 

theScreen.dispatchKeyEvent(EventInjector.TrackwheelEvent.THUMB_ROLL_DOWN, '\u0000', 0, aTime);

 

 One would think that only first and last parameter would be enough for the TrackWheel ...

 

But, seriously, does anyone have any more information about the

dispatchKeyEvent()

 

 

 method ?

 

Can I use it for (almost) full 'interscreen communication'  or not ?



"Listen carefully, I shall say this only once"