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
New Developer
dcorb
Posts: 9
Registered: ‎07-28-2008
My Device: Not Specified

Simulate key presses

I need to simulate key presses for a testing application I am developing. I have been using EventInjector.KeyEvent and EventInjector.KeyCodeEvent successfully in most cases. But when I attempt to enter number on the calculator application nothing happens. I also have this problem attempting to enter a phone number. Do I have to set a special mode like the ALT key? I am developing and testing using the 8120 simulator.  

 

Thanks,

Dave

Please use plain text.
Administrator
MSohm
Posts: 14,517
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Simulate key presses

This is a known issue with the calculator application.  It does not currently support event injection.

 

What issue are you having when entering phone numbers?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Developer
dcorb
Posts: 9
Registered: ‎07-28-2008
My Device: Not Specified

Re: Simulate key presses

I tried to enter a phone once and no digits showed up. I assumed it was the same problem as the calculator. I will revisit the issue, maybe I overlooked something.
Please use plain text.
New Developer
dcorb
Posts: 9
Registered: ‎07-28-2008
My Device: Not Specified

Re: Simulate key presses

I can inject numbers in the phone dialer if I use EventInjector.KeyCodeEvent and send a character (such 'E' for number 1, I am working with the 8120 half qwerty simulator).

 

I have been using EventInjector.KeyEvent for other applications that have text entry fields. The EventInjector.KeyEvent has no affect on the phone dialer.

 

Do I have to treat the characters as a number pad on apps like the phone dialer?

 

I am trying to determine how my application will know to send the physical key or actual character.

 

Thanks,

Dave

Please use plain text.
Administrator
MSohm
Posts: 14,517
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Simulate key presses

The Phone application is smart enough to map a character to the appropriate DTMF tone.  So injecting characters should work fine.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Developer
Yotamg
Posts: 20
Registered: ‎08-14-2008
My Device: Not Specified

Re: Simulate key presses

is it possible to inject the send (green button) when there is a phone event? (such as incoming call)
Please use plain text.