BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 02-16-2009, 04:56 PM   #1 (permalink)
Thumbs Must Hurt
 
baran_khan's Avatar
 
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Capturing key press event

Please Login to Remove!

Hi,

I am trying to build a phone book sort of application. The thing is I am trying to capture the characters in a text box and highlight the best match contact accordingly.

The problem I am facing is that I am not sure how can I capture a key press event. I have tried keyChar, keyUp, keyDown etc. methods but none seems to solve the purpose.

Does anyone know how can I capture the key press event for any alphabet or character on the device.
__________________
Smart People ask for Help!!!
Offline  
Old 02-16-2009, 05:51 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

I would try putting a FieldChangeListener on the text input field - it wil get called for each change of the text in the field.
Offline  
Old 02-16-2009, 06:05 PM   #3 (permalink)
Thumbs Must Hurt
 
baran_khan's Avatar
 
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Dougsg38p View Post
I would try putting a FieldChangeListener on the text input field - it wil get called for each change of the text in the field.
I did tried that, but didn't worked for me. See if you can get the thing done, so we don't have any direct functionality to achieve this?
__________________
Smart People ask for Help!!!
Offline  
Old 02-16-2009, 11:35 PM   #4 (permalink)
New Member
 
Join Date: Feb 2009
Model: 8700
PIN: N/A
Carrier: Vodafone
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Use Keychar

protected boolean keyChar(char key, int status, int time)

this method should help u.

but before using this disable field change listener
Offline  
Old 02-17-2009, 12:41 AM   #5 (permalink)
Thumbs Must Hurt
 
baran_khan's Avatar
 
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by SunitK View Post
protected boolean keyChar(char key, int status, int time)

this method should help u.

but before using this disable field change listener
Hey,

Thanks for the reply, I guess I got plenty to learn about. Any chance if I can get those few lines of code to get this thing done, I have tried everything from my side and I guess I am not able to get it right.

Thanks!
__________________
Smart People ask for Help!!!
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.