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

Vintage MAC V306, 15/16", 6-Point Impact Socket with a 1/2" Drive
$11.99
Vintage MAC V306, 15/16VINTAGE BERNOULLI 150 MULTIDISK MAC TRANSPORTABLE DISK DRIVE
$30.0
VINTAGE BERNOULLI 150 MULTIDISK MAC TRANSPORTABLE  DISK DRIVE  pictureVTG Lot Mack Truck Guide Maintenance Lubrication Operator's Handbook V-Mac III
$19.99
VTG Lot Mack Truck Guide Maintenance Lubrication Operator's Handbook V-Mac III pictureBranded Raw Petrol Tank For Vintage Velocette 350cc OHV, MAC, MDD & MOV Models
$159.99
Branded Raw Petrol Tank For Vintage Velocette 350cc OHV, MAC, MDD & MOV Models pictureVintage 1/2" Drive MAC VUI 166T 6 Point Impact Swivel Socket
$11.95
Vintage 1/2






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