Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
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  
  Keyboard doesn't release when display loses focus  (Read 1715 times)
0 Members and 1 Guest are viewing this topic.
Offline psiegel

Junior Member




Adamant about gaming.


« Posted 2003-04-30 12:13:21 »

To preface with my specs: Running on RedHat 9 using lwjgl 0.5

So, I noticed recently that if the Display is initialized in windowed mode and then the Keyboard is created, all keystrokes are consumed by the application, even if the window loses focus.  Most notably, this makes debugging with NetBeans difficult, as I can't hit the keystrokes to step through the code!

I think the obvious fix for this would be to simply a method to the Display object such as:  boolean hasFocus().  Then within my app I could test this during the main loop, and release the Keyboard when it is false and reclaim the keyboard when it's true.

Paul Siegel
Adamant Games, Inc.
http://www.adamantgames.com
Offline elias

Senior Member





« Reply #1 - Posted 2003-04-30 17:22:53 »

What do you mean - losing focus? The only "supported" way of releasing focus is by pressing alt+tab while the input is grabbed

Offline psiegel

Junior Member




Adamant about gaming.


« Reply #2 - Posted 2003-04-30 18:08:34 »

Well, in this case I lost focus because my debugger insisted on grabbing it when it reached a break point in the code.  Some other apps might do something similar as well, like an IM client.  Or, what if I simply clicked from one window to the other (again, this isn't fullscreen mode that I'm talking about).

Currently I do see the support for the case where the window is minimized (in Display.isMinimized()), but not for the case when other windows are simply brought to the foreground, leaving the lwjgl window still on screen, but not having focus.

Paul Siegel
Adamant Games, Inc.
http://www.adamantgames.com
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline elias

Senior Member





« Reply #3 - Posted 2003-05-02 09:24:13 »

The 0.6 pre is out, could you test again? (including the no glx-case of yours)

- elias

Offline elias

Senior Member





« Reply #4 - Posted 2003-05-02 11:58:31 »

In fact, I just fixed an issue with input focus on linux so could you test with these libs instead:

http://odense.kollegienet.dk/~naur/lwjgl-rel06-take2-rh8.zip

and Matzon, you can grab it too, along with

http://odense.kollegienet.dk/~naur/lwjgl-rel06-take2-suse81.zip

for the release.

- elias

Offline psiegel

Junior Member




Adamant about gaming.


« Reply #5 - Posted 2003-05-03 16:29:13 »

I've played with this a bit more, and the problem seems to be actually specific to debugging using NetBeans IDE.  I can load up an app that uses lwjgl for keyboard input and a text editor, and switch between them and have them react just fine.  It's only when debugging in NetBeans that all hell seems to break loose.  I'm getting behavior that ranges from the debugger simply ignoring key presses to the mouse completely bugging out and flashing all over the screen making the computer useless until I kill both processes (the debugger and the app being debugged).

Anyway, I will try to nail down exactly what causes the problem.  But for now, it seems such an isolated issue it shouldn't be too hard to work around.  I could just use a lot of System.out.printlns instead of the interactive debugger.

Paul Siegel
Adamant Games, Inc.
http://www.adamantgames.com
Offline elias

Senior Member





« Reply #6 - Posted 2003-05-03 18:42:21 »

What about your segfault when GLX is disabled, did the new libs fix it?

- elias

Offline psiegel

Junior Member




Adamant about gaming.


« Reply #7 - Posted 2003-05-04 01:44:42 »

Aw, you're confusing me now jumping topics from one forum to the other.  I won't get a chance to test the GLX issue again until I'm at work on Monday, as it's that machine that I've been finding the error on.  When I get to test it, I will post my results on the fourm titled "Running and Distributing in Linux".

If I can narrow my issue with debugging in NetBeans, I will post the info regarding that here.

Paul Siegel
Adamant Games, Inc.
http://www.adamantgames.com
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.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (19 views)
2014-09-24 16:12:06

Grunnt (44 views)
2014-09-23 14:38:19

radar3301 (27 views)
2014-09-21 23:33:17

BurntPizza (62 views)
2014-09-21 02:42:18

BurntPizza (32 views)
2014-09-21 01:30:30

moogie (39 views)
2014-09-21 00:26:15

UprightPath (50 views)
2014-09-20 20:14:06

BurntPizza (54 views)
2014-09-19 03:14:18
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!