Login  Register

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

Posted by Xerxes Rånby on Mar 05, 2013; 10:14am
URL: https://forum.jogamp.org/JOGL-2-0-OpenGL-OpenGL-ES-backend-for-LibGDX-tp4027689p4028493.html

krishnak wrote
ASDW keys do not move the camera. The console though gets all the key events . This is true with and with out X. Any thoughts.

Edit: If I was unclear, if I run the code on a PC using JOGL renderer it picks up the ASDW keys and moves the camera which doesn't happen on the Pi
Please double check that your Linux distribution allows your user to read the /dev/input/event* files
This is how the LinuxEventDeviceTracker operate, JOGL read keyboard input directly from these files on the Rasberry Pi and is supposed to work regardless if X11/console login is in use or not.

To my knowledge Rasbian do allow all users to read from these files.
run the following command to see the current premissions in use by your linux distribution:
ls -la /dev/input/event*
You may force these files to be readable by all users if they happen to be non-readable.
sudo chmod a+r /dev/input/event*

You can manually test the JOGL LinuxEventDeviceTracker by running:
cd jogamp-all-platforms
java -cp jar/gluegen-rt.jar:jar/jogl-all.jar jogamp/newt/driver/linux/LinuxEventDeviceTracker

You are expected to see the following output when pressing the ESC key:
[time 1362478317:4949] type 4 / code 4 = value 458793
[time 1362478317:4956] type 1 / code 1 = value 0
[time 1362478317:4958] type 0 / code 0 = value 0
[time 1362478318:-4291] type 4 / code 4 = value 458793
[time 1362478318:-4286] type 1 / code 1 = value 1
[time 1362478318:-4284] type 0 / code 0 = value 0

The Linux /dev/input/event* files includes informatino for all keyboard presses, mouse movements, scroll wheels powerbuttons etc.. the LinuxEventDeviceTracker uses this information to generate the NEWT Keyboard events on the Raspberry PI.