You Are Here:

Community: Developer Discussion Boards

#1 Old KeyListener Problem on the 9210i(Java) - 2003-11-30, 01:59

Join Date: Apr 2003
Posts: 13
MeanSmile
Offline
Registered User
I have been havign allot of difficulty tryig to work out how to use the KeyListener methods for the 9210i(Java). i made a simple enough program and added a keylistener to the main frame then made methods to listen to the presses like KeyPressed etc...
public blah()
{
...
...
addKeyListener(this);
...
}
....
...
public void KeyPressed(....)
{
...
}

now this all works fine BUT i have buttons in the main frame and tghey take focus unless u actualy turn on the pointer and point to the frame(outside of the buttons) only then does the keylistener work, and then a nother problem occurs.
I want to be bale to detect the use of the arrow keys UP DOWN LEFT RIGHT(the joystick thingy) when i press any of these keys(UP DOWN LEFT RIGHT) the keylistser returns a:
UKNOWWN KEY STROKE ['?']

does anyone knwo how to solve both or one of these problems???
1-make the entire program be able to listen to keys(not just the main frame an dnot by asigning a key listener to every object in the frame)
2-detectgin the arrow keys

Thanks
Leon
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia