Hello Guest

[FIXED] Control key incorrectly reported as up when mouse pressed

  • 10 Replies
  • 13077 Views
*

Offline NateS

  • **
  • 91
    • Esoteric Software
It seems when using Display.setParent, if I hold control and press the mouse that control is momentarily reported as being up.

Executable example:
Code: [Select]
Canvas canvas = new Canvas();
JFrame frame = new JFrame("Test");
frame.add(canvas);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(new Dimension(640, 480));
frame.setLocationRelativeTo(null);
frame.setVisible(true);

Display.setParent(canvas);
Display.setVSyncEnabled(true);
Display.create();
while (!Display.isCloseRequested()) {
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
Display.update();
if (!Keyboard.isKeyDown(Keyboard.KEY_LCONTROL)) //
System.out.println("control is up " + System.currentTimeMillis());
}

This occurs on Windows 7 64bit using LWJGL 2.8.5 and Java 1.7.0_02.
« Last Edit: November 20, 2012, 12:43:07 by kappa »

*

Offline NateS

  • **
  • 91
    • Esoteric Software
Re: [BUG] Control key incorrectly reported as up when mouse pressed
« Reply #1 on: November 19, 2012, 11:11:51 »
This makes control + click to multi select in my app very annoying. :) Half the time the control is not considered pressed.

*

Offline Grum

  • *
  • 16
Re: [BUG] Control key incorrectly reported as up when mouse pressed
« Reply #2 on: November 19, 2012, 11:47:09 »
Seems to have to do with: https://github.com/LWJGL/lwjgl/issues/1

*

Offline kappa

  • *****
  • 1319
Re: [BUG] Control key incorrectly reported as up when mouse pressed
« Reply #3 on: November 19, 2012, 11:52:11 »
Seems like a new issue introduced in LWJGL 2.8.5 as reports suggest that it works as normal on LWJGL 2.8.4, there were some changes made to the input handling on Windows (to allow keys to release when Display is not focused). Likely its related to that change.
« Last Edit: November 19, 2012, 11:55:51 by kappa »


*

Offline spasi

  • *****
  • 2225
    • WebHotelier
Re: [BUG] Control key incorrectly reported as up when mouse pressed
« Reply #5 on: November 19, 2012, 13:03:08 »
The root cause is that we receive KILLFOCUS/SETFOCUS events whenever there's a mouse click. This only happens with Display.setParent, with the native window it's ok.

*

Offline spasi

  • *****
  • 2225
    • WebHotelier
Re: [BUG] Control key incorrectly reported as up when mouse pressed
« Reply #6 on: November 19, 2012, 17:21:45 »
I managed to get rid of the redundant focus events, but the changes looked too risky. I've fixed this particular issue though. You'll have to build manually until the nightly builds are updated to use github.

*

Offline spasi

  • *****
  • 2225
    • WebHotelier
Re: [BUG] Control key incorrectly reported as up when mouse pressed
« Reply #7 on: November 20, 2012, 11:35:22 »
I committed the fix to SVN too, this build includes it.

*

Offline NateS

  • **
  • 91
    • Esoteric Software
Re: [FIXED] Control key incorrectly reported as up when mouse pressed
« Reply #8 on: November 21, 2012, 08:26:10 »
Many thanks! When do you think the next point release will be? I'd like to update libgdx.

*

Offline Matzon

  • *****
  • 2242
Re: [FIXED] Control key incorrectly reported as up when mouse pressed
« Reply #9 on: November 21, 2012, 21:57:03 »
nightly builds need should probably run correctly from github. Endolf is on it, but its a bit problematic due to version conflict between the OS, github and git.

*

Offline NateS

  • **
  • 91
    • Esoteric Software
Re: [FIXED] Control key incorrectly reported as up when mouse pressed
« Reply #10 on: November 23, 2012, 08:45:59 »
Verified fix in build #1888.  :)