Keyboard input only works as root

Ok, I have to admit that I am stumped. I have tried setting permissions for the device nodes to 755, adding groups to my user  and a variety of other magics. Still no success with getting keyboard input to work as a non-root user. Mouse input works perfectly. I initially tried 32bit libraries and a 32bit jvm as well, all to no avail. Does any know how to resolve this issue? (I am guessing it is something ridiculously trivial)



Problem description



The keyboard is being correctly picked up as an device. However, when executing the jme test applications as a normal user, keyboard events are not processed. Executing as root results in normal execution (event are processed normally).  



Environment information



System: Archlinux 64 bit (Currently Archlinux)

Java: 1.6.0_18 (64bit)

udev: 151-3

hal: 0.5.14

JME: Checked out the trunk from the svn repository.



Note


  • I have had the same problem with Gentoo.

  • Downloading and trying to run jinput only results in the same problem, so it is a jinput issue. This was tested and confirmed some months ago, if the debug output from that would help I will try it again. If memory serves the error/log output had to do with access/read issues.




I have really been wanting to get into development with jme for a couple of months now, but have never had the time to move past this problem. Day job in Japan takes to much time (T.T) and the rest of my spare time went to studying Tapestry... ><;

Why aren't you using LWJGL's Keyboard class? It might be that JInput allows  you to access keyboard even when the app isn't in focus, which could be used to implement keyloggers etc. You should access the keyboard with the safe method in LWJGL Keyboard. JInput is only for gamepads/joysticks.

Well, that would explain the issues when I tested jinput directly. Thank you for correcting me on this.



However,  my current issues occurs when running tests from the testchooser (ant run-testchooser).  Mouse input works fine, but keyboard input just goes… somewhere. 



I initially though it to be a 64 bit related issue (there was a bug related to this, right), but the same problem occured when using the jME3 tests (for which the bug was supposedly fixed)…  Afterwards I tried running as root, and all keyboard input worked properly.

Okay I see. Try going to http://www.lwjgl.org/ and post on their forums that the Keyboard class isn't receiving events when running on your Linux.

Ok, I managed to get it sorted it. It's actually a known issue with IME providers in Linux.  Root was unaffected by it as IME was not set up for it. Quiting iBus and then running the jME apps fixed the issue. This is however quite a bit of a problem, given that I use said input method the whole time. Might have to install windows…  :cry:



Anyway, thanks for the responses!

There is still a bug with Ubuntu and Java applications. Here is a link to the bug report.