Posted by
lex on
Aug 17, 2011; 7:49pm
URL: https://forum.jogamp.org/Wrong-keyCodes-with-NEWT-on-Linux-tp3256939p3262747.html
I use Arch Linux, 64 bit version, with standard X and KDE 4.7 vanilla setup. Java version is 7. JOGL version is 2.0.rc2 (Released on 03-Mar-2011), downloaded from "
http://jogamp.org/deployment/webstart/".
I have been playing with JOGL and NEWT for a while, but havent started a serious project until now. I had problems with fullScreen not functioning correctly as far back as Java 6 and JOGL 2.0.rc1. Though I don't know about the input issues with earlier versions.
My window setup is as follows (copied from one of the examples and then modified):
[code]
NewtFactory.setUseEDT(true)
val display = NewtFactory.createDisplay(null)
val screen = NewtFactory.createScreen(display, 0)
val profile = GLProfile.get(GLProfile.GL2ES2)
if (profile == null) throw new RuntimeException("Required GL profile is not supported.")
val capabilities = new GLCapabilities(profile)
val newtWindow = NewtFactory.createWindow(screen, capabilities)
val window = GLWindow.create(newtWindow)
val exitListener = new WindowAdapter with KeyListener {
override def windowDestroyNotify(e: WindowEvent) { quit = true }
def keyPressed(e: NKeyEvent) {}
def keyReleased(e: NKeyEvent) { if (e.getKeyCode() == NKeyEvent.VK_ESCAPE) quit = true }
def keyTyped(e: NKeyEvent) {}
}
window.addWindowListener(exitListener)
window.addKeyListener(exitListener)
window.addKeyListener(wrappedInput)
window.addMouseListener(wrappedInput)
window.addGLEventListener(glEventListener)
window.setAutoSwapBufferMode(true)
window.setPosition(0, 0)
window.setSize(800, 600)
window.setVisible(true)
window.setFullscreen(false)
window.enablePerfLog(false)
window.requestFocus()
[/code]
My wild guess at the moment is that I am using outdated natives libraries. I am working on an ANT script to download all the libraries and launch a simple example. Then I will test it on my system and some live-cd versions of linux.