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

Started by NateS, November 18, 2012, 07:15:09

Previous topic - Next topic

NateS

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

Executable example:
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.

NateS

This makes control + click to multi select in my app very annoying. :) Half the time the control is not considered pressed.


kappa

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.


spasi

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.

spasi

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.

spasi


NateS

Many thanks! When do you think the next point release will be? I'd like to update libgdx.

Matzon

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.

NateS