Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (512)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Who stole the TAB KeyEvent  (Read 1508 times)
0 Members and 1 Guest are viewing this topic.
Offline MGodehardt

Junior Duke




why does the chicken cross the road?


« Posted 2003-09-18 13:34:05 »

Since JDK 1.4.0 the processKeyEvent does no longer report KEY_PRESS or KEY_RELEASE of the TAB key, damn did anybody find a workaround for this ?

Yes i have enabled AWT KeyEvents ! everything else works fine ( like ENTER or BACKSPACE )
Offline lamster

Senior Newbie





« Reply #1 - Posted 2003-09-18 17:34:32 »

I think what you want is

// I'd like to see the TAB, Shift-TAB events, thank you:
(myFrame).setFocusTraversalKeysEnabled( false );

during the setup of your Frame
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #2 - Posted 2003-09-18 22:00:29 »

You can set that for a specific component and have tab work as a focus traversal key in other components...

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Abuse

JGO Knight


Medals: 13


falling into the abyss of reality


« Reply #3 - Posted 2003-09-19 06:46:50 »

That little change by Sun will have broken any old code that relied on the tab key.

Its also counterintuitive that processKeyEvent reports all KeyEvents *except* the Tab key.

IMO, that is a bug :-/

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline MGodehardt

Junior Duke




why does the chicken cross the road?


« Reply #4 - Posted 2003-09-19 10:29:07 »

yes thanks for that info, if u write an applet based on 1.1 and this applet is running under 1.4, you will get no TAB key pressed.

Now i dynamically load the method and invoke it ( if the method exists ).

Thats the workaround and i am happy, i have now a TAB key again.
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #5 - Posted 2003-09-19 13:00:26 »

Quote
That little change by Sun will have broken any old code that relied on the tab key.

Its also counterintuitive that processKeyEvent reports all KeyEvents *except* the Tab key.

IMO, that is a bug :-/


A change in behaviour but not a bug.  They needed to improve focus support.  Tabbing between text fields on a form, etc.  Sometimes you have to break compatibility to move forward... something Microsoft should learn some day **COUGH**DOS SHELL**COUGH**

Offline Abuse

JGO Knight


Medals: 13


falling into the abyss of reality


« Reply #6 - Posted 2003-09-19 13:32:07 »

i understand the need for the focus managment; but there is no reason why the KeyEvent can't be delivered to processKeyEvent as well as being processed by the focus manager.
Is there?

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline MGodehardt

Junior Duke




why does the chicken cross the road?


« Reply #7 - Posted 2003-09-19 15:23:10 »

I never use native controls, i have my own set of controls ( edit, listboxes and so on ) and tabbing was working wonderful and is still working with 1.4, but Panels and Frames do not get the TAB Key Event, i hate Swing ( heavy ) and i only use AWT.

With the knowledge that this behaviour has changed, its easy to implement the fix i posted above.
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #8 - Posted 2003-09-19 15:29:23 »

Quote
i understand the need for the focus managment; but there is no reason why the KeyEvent can't be delivered to processKeyEvent as well as being processed by the focus manager.
Is there?


The reason that comes to mind is that if you have a text component and someone hits TAB you want to EITHER type a tab character into the components document, OR move focus.
If the TAB is added to the document AND the focus changes that is obviously a problem.

In other words you don't want the one key press to do two unrelated things (e.g. bring up a chat window in your game and move focus to your QUIT button.)

Sure there might be other ways to solve this, but they could just complicate things even more.

P.S.  I LOVE Swing (heavy) Smiley

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (50 views)
2014-10-17 03:59:02

Norakomi (39 views)
2014-10-16 15:22:06

Norakomi (31 views)
2014-10-16 15:20:20

lcass (35 views)
2014-10-15 16:18:58

TehJavaDev (66 views)
2014-10-14 00:39:48

TehJavaDev (65 views)
2014-10-14 00:35:47

TehJavaDev (55 views)
2014-10-14 00:32:37

BurntPizza (72 views)
2014-10-11 23:24:42

BurntPizza (43 views)
2014-10-11 23:10:45

BurntPizza (84 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!