LWJGL
May 19, 2013, 00:05:12 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL is now using GitHub
 
   Home   Help Search Login Register  



Pages: 1 [2]
  Print  
Author Topic: [BUG] Keyboard.isKeyDown() returns false true  (Read 5633 times)
Matzon
Administrator
Demigod
*****
Posts: 2237



« Reply #15 on: August 06, 2012, 02:32:09 »

patch hasn't been applied... - and thats a good thing, imo.

The call to WindowsKeyboard.nukeDownKeys(); on all WM_MOVE and WM_WINDOWPOSCHANGING seems extremely excessive?
Logged

ra4king
Newbie
*
Posts: 33


I'm the King!


WWW
« Reply #16 on: August 06, 2012, 12:04:55 »

Yeah this patch hasn't been incorporated yet. KappaOne told me this needed more testing, even the only change is in Java and this mostly affects Windows. However, I have tested it on Windows and Linux and it works Smiley

EDIT: @Matzon, nukeDownKeys only nukes the keys once, all further calls are ignored until the keys are set again.
Logged

-Roi
aldacron
Regular nerd
**
Posts: 67


« Reply #17 on: August 07, 2012, 05:29:22 »

The proper solution to this (on Windows) has to be implemented on the native side. When a mouse button is pressed, the Win32 API function SetCapture should be called. This guarantees that the window will continue receiving mouse button events even when the mouse is outside the window and does not block other windows from getting those same events. Then, when a button up event is received, ReleaseCapture should be called. Using this approach will allow LWJGL's internal mouse button state to remain consistent and not interfere with other programs.

There are likely alternatives for the other OSes, if it is an issue there. The GLFW library uses this approach on Windows and AFAIK behaves consistently across its supported platforms.
Logged
NateS
Regular nerd
**
Posts: 79


« Reply #18 on: August 16, 2012, 10:09:33 »

Just want to throw in my "me too!". A fix for this would be great. Every once in a while switching to/from my app, the ctrl key gets stuck down. This is a modifier in my app and its very confusing for a moment. The repro is simply: press ctrl, lose window focus, release ctrl, focus window. It then sees ctrl down until pressed again.
Logged
NateS
Regular nerd
**
Posts: 79


« Reply #19 on: August 23, 2012, 00:41:20 »

I've been spending a lot of time using my desktop tools. I curse this issue every single day! Embarrassed
Logged
spasi
Nerdus Imperius
*****
Posts: 752



WWW
« Reply #20 on: August 23, 2012, 03:53:16 »

I committed a fix for this on Windows, please test the next nightly build.
Logged
kappa
Administrator
Nerdus Imperius
*****
Posts: 1111



« Reply #21 on: August 23, 2012, 06:00:56 »

I committed a fix for this on Windows, please test the next nightly build.
Nice job.

Just curious, WindowsKeyboard.fireLostKeyEvents() is called every frame, we might be able to get away with only calling it on focus change (i.e. when WindowsDisplay.appActive(boolean) method is called). Not sure if it'll have any practical effect on performance but if it works it should reduce a number of jni calls each frame.
Logged
spasi
Nerdus Imperius
*****
Posts: 752



WWW
« Reply #22 on: August 23, 2012, 07:00:38 »

It's only called on appActive(true).
Logged
kappa
Administrator
Nerdus Imperius
*****
Posts: 1111



« Reply #23 on: August 23, 2012, 07:02:31 »

It's only called on appActive(true).
Ah cool, guess I read code wrong, sorry.
Logged
ra4king
Newbie
*
Posts: 33


I'm the King!


WWW
« Reply #24 on: August 23, 2012, 14:33:15 »

The new commit isn't showing up on CIA, but it is on SourceForge.
Logged

-Roi
NateS
Regular nerd
**
Posts: 79


« Reply #25 on: August 27, 2012, 22:37:17 »

I committed a fix for this on Windows, please test the next nightly build.
Sorry for the delay. With the nightly #1782, I start my app and ctrl is correctly not reported as pressed. After pressing and releasing ctrl, ctrl is incorrectly reported as still being pressed. Subsequent presses of ctrl do not remedy the problem. Ctrl is reported and being pressed until I focus a different application and then return to my app.

TLDR; clearing the button states seems to work, but normal usage is now broken.
Logged
spasi
Nerdus Imperius
*****
Posts: 752



WWW
« Reply #26 on: August 28, 2012, 02:06:48 »

Thanks, fixed on next nightly.
Logged
NateS
Regular nerd
**
Posts: 79


« Reply #27 on: December 03, 2012, 15:30:21 »

I've got a bug report from a Linux user where if they use ctrl+alt+arrow to switch desktops, when they switch back the ctrl key is reported as down until it is pressed again.
Logged
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!