BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-24-2009, 03:39 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default how to simulate key?

Please Login to Remove!

hi,

i know that there are functions which represents down and up positions of key-keyUp and keyDown. but they do not work as should. in api it is written that keyDown "Represents a constant indicating that the key is in the down position." but as i try to use it in my application, i realized that keyDown does not represent only a key in a down position but fully click- so down and up..

is there any way that i could simulate key in a down position?

kind regards
Offline  
Old 03-24-2009, 03:45 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

what i need to do is simulate shortcut of two keys pressed-> alt + arrow.

So, i must at first simulate alt in a down position, hold it, then simulate arrow click and then release alt key.

is there any chance i can do it?
Offline  
Old 03-24-2009, 07:59 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

it looks like such a code may work:

EventInjector.KeyCodeEvent _e = new EventInjector.KeyCodeEvent(
EventInjector.KeyCodeEvent.KEY_DOWN,
(char)Keypad.KEY_ESCAPE,
KeypadListener.STATUS_ALT,
500
);

_e.post();

but, when i'm in my application it works only as 'escape'. when i'm in foreground (main screen of my device) this code works as i wanted-as a shortcut of alt+escape(arrow).

Can anyone know why? how can i do that this shortcut works also in my application?

kind regards
Offline  




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