BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 06-29-2009, 06:07 AM   #1 (permalink)
New Member
 
Join Date: Jun 2009
Model: 8100
PIN: N/A
Carrier: airtel
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Green key press programatically

Please Login to Remove!

Hi,
I have tired with below code but i could not able to press the green key .Please help me where am i wrong?
Quote:
EventInjector.KeyCodeEvent pressEndKey = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEv ent.KEY_DOWN,
(char)Keypad.key(1114112), KeypadListener.STATUS_NOT_FROM_KEYPAD,100);
EventInjector.KeyCodeEvent releaseEndKey = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEv ent.KEY_UP,
(char)Keypad.key(1114112), KeypadListener.STATUS_NOT_FROM_KEYPAD,100);
EventInjector.invokeEvent(pressEndKey);
EventInjector.invokeEvent(releaseEndKey);
Thanks,
Offline  
Old 08-18-2009, 06:53 AM   #2 (permalink)
New Member
 
Join Date: Jul 2009
Model: 8130
PIN: N/A
Carrier: Mobilink
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

For giving programatically permission your should do the following settings:
Go to Options -> Advanced Options -> Applications > Press Menu key > Modules > select your application > Press Menu key > Edit Permissions > Expand Interaction option-> set to allow keystrokeinjection permission.

Then try this piece of code:
EventInjector.KeyCodeEvent pressEndKey = new
EventInjector.KeyCodeEvent(
KeyCodeEvent.KEY_DOWN,( char)
Keypad.KEY_SEND,0,100);

EventInjector.KeyCodeEvent releaseEndKey =
new EventInjector.KeyCodeEvent(
KeyCodeEvent.KEY_UP,(char)
Keypad.KEY_SEND,0,100);

try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
EventInjector.invokeEvent(pressEndKey);
EventInjector.invokeEvent(releaseEndKey);
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Lot of 4 New OEM IBM 1372475 Pageprinter 3130 Fuser 100v
$8.66
Lot of 4 New OEM IBM 1372475 Pageprinter 3130 Fuser 100v pictureLot of 4 New OEM IBM 57P1975 Infoprint 70 Plus Black Toner
$7.36
Lot of 4 New OEM IBM 57P1975 Infoprint 70 Plus Black Toner  pictureNEW IBM SELECTRIC TYPEWRITER PART, ROTATE TAPE SPRING DRUM OEM NOS
$9.99
NEW IBM SELECTRIC TYPEWRITER PART, ROTATE TAPE SPRING DRUM OEM NOS  pictureIBM SELECTRIC TYPEWRITER PART OEM CARRIAGE RETURN SPRING PINION SET ORIGINAL NOS
$9.99
IBM SELECTRIC TYPEWRITER PART OEM CARRIAGE RETURN SPRING PINION SET ORIGINAL NOS pictureIBM SELECTRIC TYPEWRITER PART OEM TAB SPRING and PINION SET ORIGINAL NOS
$9.99
IBM SELECTRIC TYPEWRITER PART OEM TAB SPRING and PINION SET ORIGINAL NOS picture






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