BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 02-16-2009, 05:56 PM   #1
baran_khan
Thumbs Must Hurt
 
baran_khan's Avatar
 
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
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, 06:51 PM   #2
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
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, 07:05 PM   #3
baran_khan
Thumbs Must Hurt
 
baran_khan's Avatar
 
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
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-17-2009, 12:35 AM   #4
SunitK
New Member
 
Join Date: Feb 2009
Model: 8700
PIN: N/A
Carrier: Vodafone
Posts: 7
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, 01:41 AM   #5
baran_khan
Thumbs Must Hurt
 
baran_khan's Avatar
 
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


OEM iPhone 11 PRO X/XR XS MAX 8/7 PLUS Fast Charging USB Cable 10 Feet & 6 Feet  picture

OEM iPhone 11 PRO X/XR XS MAX 8/7 PLUS Fast Charging USB Cable 10 Feet & 6 Feet

$2.99



iPhone 13 12 11 PRO MAX XR XS 8/7/6 Fast Charger USB Data Cable cord 10 feet/3M picture

iPhone 13 12 11 PRO MAX XR XS 8/7/6 Fast Charger USB Data Cable cord 10 feet/3M

$4.99



10 Feet/3M For iPhone 13 12 11 PRO MAX MINI  X XR XS 8 7 Fast Charging USB Cable picture

10 Feet/3M For iPhone 13 12 11 PRO MAX MINI X XR XS 8 7 Fast Charging USB Cable

$5.00



10 Foot/3M iPhone 12/11 PRO MAX X/10 XR XS 8/7 FAST Charging USB LONG Cable cord picture

10 Foot/3M iPhone 12/11 PRO MAX X/10 XR XS 8/7 FAST Charging USB LONG Cable cord

$4.98



NEW OEM Battery A1466 A1369 A1496 A1405 A1377 A1466 for MacBook Air 13 inch picture

NEW OEM Battery A1466 A1369 A1496 A1405 A1377 A1466 for MacBook Air 13 inch

$31.90



Genuine A1417 OEM Battery Apple Macbook Pro 15 Retina A1398 Mid 2012 Early 2013 picture

Genuine A1417 OEM Battery Apple Macbook Pro 15 Retina A1398 Mid 2012 Early 2013

$37.90







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