BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-05-2007, 12:28 AM   #1 (permalink)
New Member
 
Join Date: Mar 2007
Location: Shanghai
Model: 8700c
Carrier: Cingular
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default How to "Select All" text in an EditField?

Please Login to Remove!

Hi,

There is an EditField with prefilled text in it. I'd like to make it selected all when the screen shows. How to do it? Anybody knows why the "left shift" key simulation does not take effect?

Thanks in advance!

I tried using EventInjector to simulate user pressing left shift and then moving the navigation move (it's a 8800 device), but it does not work. My code is as below:

EventInjector.KeyCodeEvent keyCodeEvent = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEv ent.KEY_DOWN,
(char)Keypad.KEY_LEFT_SHIFT, KeypadListener.STATUS_NOT_FROM_KEYPAD,
1000);
EventInjector.invokeEvent(keyCodeEvent);
EventInjector.NavigationEvent e = new EventInjector.NavigationEvent(EventInjector.Naviga tionEvent.NAVIGATION_MOVEMENT,
100, 0, KeypadListener.STATUS_ALT | KeypadListener.STATUS_NOT_FROM_KEYPAD | KeypadListener.STATUS_KEY_HELD_WHILE_ROLLING);
EventInjector.invokeEvent(e);
keyCodeEvent = new EventInjector.KeyCodeEvent(EventInjector.KeyCodeEv ent.KEY_UP,
(char)Keypad.KEY_LEFT_SHIFT, KeypadListener.STATUS_NOT_FROM_KEYPAD,
1000);
EventInjector.invokeEvent(keyCodeEvent);
Offline  
Old 03-08-2007, 10:06 PM   #2 (permalink)
New Member
 
Join Date: Mar 2007
Location: Shanghai
Model: 8700c
Carrier: Cingular
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I solved it myself - the alt key event was caught somewhere else. Closing...
Offline  
Old 04-09-2007, 03:48 PM   #3 (permalink)
New Member
 
Join Date: Feb 2006
Location: Colombia
Model: 8800
Carrier: Cingular
Posts: 12
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by xiaogy0318
I solved it myself - the alt key event was caught somewhere else. Closing...
Could you use the EventInjector class successfully? Can you explain me how to use t, I`ve been tryingt it but I could not.
Offline  
Old 04-10-2007, 05:42 AM   #4 (permalink)
New Member
 
Join Date: Mar 2007
Location: Shanghai
Model: 8700c
Carrier: Cingular
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Below is what I used for 8800. Hope it would help.

EventInjector.NavigationEvent e;
e = new EventInjector.NavigationEvent(EventInjector.Naviga tionEvent.NAVIGATION_MOVEMENT, 200, 0,
KeypadListener.STATUS_NOT_FROM_KEYPAD);
EventInjector.invokeEvent(e);
EventInjector.KeyEvent keyEvent = new EventInjector.KeyEvent(EventInjector.KeyEvent.KEY_ DOWN,
Keypad.map(Keypad.KEY_ALT), KeypadListener.STATUS_ALT | KeypadListener.STATUS_NOT_FROM_KEYPAD, 0);
EventInjector.invokeEvent(keyEvent);
keyEvent = new EventInjector.KeyEvent(EventInjector.KeyEvent.KEY_ UP, Keypad.map(Keypad.KEY_ALT),
KeypadListener.STATUS_ALT | KeypadListener.STATUS_NOT_FROM_KEYPAD, 0);
EventInjector.invokeEvent(keyEvent);
e = new EventInjector.NavigationEvent(EventInjector.Naviga tionEvent.NAVIGATION_CLICK, 0, 0,
KeypadListener.STATUS_ALT | KeypadListener.STATUS_NOT_FROM_KEYPAD);
EventInjector.invokeEvent(e);
e = new EventInjector.NavigationEvent(EventInjector.Naviga tionEvent.NAVIGATION_UNCLICK, 0, 0,
KeypadListener.STATUS_ALT | KeypadListener.STATUS_NOT_FROM_KEYPAD);
EventInjector.invokeEvent(e);
e = new EventInjector.NavigationEvent(EventInjector.Naviga tionEvent.NAVIGATION_MOVEMENT, Controller.EVENT_INJECTOR_END_TAG, 0,
KeypadListener.STATUS_NOT_FROM_KEYPAD);
EventInjector.invokeEvent(e);
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





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