[FIXED] ALT key freezes app on Windows when using setParent, LWJGL 2.9.2

Started by NateS, July 21, 2014, 18:23:09

Previous topic - Next topic

NateS

Pressing and releasing the ALT key causes Display.update() to block until the mouse is clicked or another key is pressed. I'm using LWJGL 2.9.2 and Display.setParent and the problem occurs on Windows.

This problem is confusing for users if they press ALT on accident and also means I can't use ALT for my application.

Executable example:

import java.awt.Canvas;
import java.awt.Dimension;

import javax.swing.JFrame;

import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.GL11;

public class Test {
	public static void main (String[] args) throws Exception {
		LwjglNativesLoader.load(); // From gdx-backend-lwjgl.

		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();
			// Press and release ALT on Windows, the printing stops until you press a key or click.
			System.out.println(Mouse.getX() + ", " + Mouse.getY());
		}
	}
}


Thanks!

spasi

Thanks, it should be fixed on the next nightly build. F10 was also causing the same behavior.

NateS

Wooooo thanks spasi! Using the ALT key will allow so many new modifiers for Spine! 8)

Tested and it's working. :)