BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-26-2007, 12:20 AM   #1 (permalink)
New Member
 
Join Date: Apr 2007
Model: 8100
PIN: N/A
Carrier: china mobile
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default successful! end a call programmaticly

Please Login to Remove!

Hi Guys,

I have solved the problem of ending a active call programmaticly.because I found the keycode of RED END KEY

(test succeed on 8100)

below is my code:
Code:
 
EventInjector.KeyCodeEvent pressEndKey=new EventInjector.KeyCodeEvent(KeyCodeEvent.KEY_DOWN,(char)20,KeypadListener.STATUS_NOT_FROM_KEYPAD,100);
EventInjector.KeyCodeEvent releaseEndKey=new EventInjector.KeyCodeEvent(KeyCodeEvent.KEY_UP,(char)20,KeypadListener.STATUS_NOT_FROM_KEYPAD,100);
EventInjector.invokeEvent(pressEndKey);
EventInjector.invokeEvent(releaseEndKey);
and then some setings need to be made.

Home Screen---Options---advanced Options---Applications--- find out you program---click Menu button---Edit Permission---expand "Interactions"----change "Keystroke injection" to "Allow"

Last edited by franktian : 04-26-2007 at 12:22 AM.
Offline  
Old 04-26-2007, 02:03 AM   #2 (permalink)
New Member
 
Join Date: Apr 2007
Model: 8100
PIN: N/A
Carrier: china mobile
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Test succeed on 8800 too

change the keycode to 18 or Keypad.KEY_END
Code:
EventInjector.KeyCodeEvent pressEndKey=new EventInjector.KeyCodeEvent(KeyCodeEvent.KEY_DOWN,(char)18,KeypadListener.STATUS_NOT_FROM_KEYPAD,100);
EventInjector.KeyCodeEvent releaseEndKey=new EventInjector.KeyCodeEvent(KeyCodeEvent.KEY_UP,(char)18,KeypadListener.STATUS_NOT_FROM_KEYPAD,100);
EventInjector.invokeEvent(pressEndKey);
EventInjector.invokeEvent(releaseEndKey);
or
Code:
EventInjector.KeyCodeEvent pressEndKey=new EventInjector.KeyCodeEvent(KeyCodeEvent.KEY_DOWN,(char)Keypad.KEY_END,KeypadListener.STATUS_NOT_FROM_KEYPAD,100);
EventInjector.KeyCodeEvent releaseEndKey=new EventInjector.KeyCodeEvent(KeyCodeEvent.KEY_UP,(char)Keypad.KEY_END,KeypadListener.STATUS_NOT_FROM_KEYPAD,100);
EventInjector.invokeEvent(pressEndKey);
EventInjector.invokeEvent(releaseEndKey);
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.