Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (500)
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 1404 times)
0 Members and 1 Guest are viewing this topic.
Offline MGodehardt

Junior Member




why does the chicken cross the road?


« Posted 2003-09-18 15: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 19: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




Where's the Kaboom?


« Reply #2 - Posted 2003-09-19 00: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 Coder


Medals: 10


falling into the abyss of reality


« Reply #3 - Posted 2003-09-19 08: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 Member




why does the chicken cross the road?


« Reply #4 - Posted 2003-09-19 12: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




Where's the Kaboom?


« Reply #5 - Posted 2003-09-19 15: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 Coder


Medals: 10


falling into the abyss of reality


« Reply #6 - Posted 2003-09-19 15: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 Member




why does the chicken cross the road?


« Reply #7 - Posted 2003-09-19 17: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




Where's the Kaboom?


« Reply #8 - Posted 2003-09-19 17: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.

xsi3rr4x (48 views)
2014-04-15 18:08:23

BurntPizza (44 views)
2014-04-15 03:46:01

UprightPath (60 views)
2014-04-14 17:39:50

UprightPath (42 views)
2014-04-14 17:35:47

Porlus (58 views)
2014-04-14 15:48:38

tom_mai78101 (81 views)
2014-04-10 04:04:31

BurntPizza (140 views)
2014-04-08 23:06:04

tom_mai78101 (240 views)
2014-04-05 13:34:39

trollwarrior1 (200 views)
2014-04-04 12:06:45

CJLetsGame (207 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!