Hi guys.
I’m so sorry, but I’m a newbie in jME and in gamedev as well. And unfortunately I’ve no any tutor by this topic to ask him.
So now I learn basic tutorials from https://wiki.jmonkeyengine.org/jme3/beginner
Everything went well but I faced a problem. When I researched HelloCollision example, I found out that QWERTY keys did not work, i.e. they did not respond to pressing of my keyboard. But! Space key did! (WASD - for moving, like in example).
OK. I checked my code twice and after that copied and pasted it from example. Keys had no response, but Space key had. After that I tried to add System.out.println into that part:
public void onAction(String binding, boolean isPressed, float tpf) {
switch (binding) {
case “Jump”:
System.out.println(“Jump”);
if (isPressed) { player.jump(new Vector3f(0,20f,0));}
break;
case “Left”:
System.out.println(“Left”);
// left = isPressed;
break;
case “Right”:
System.out.println(“Right”);
// right= isPressed;
break;
case “Up”:
System.out.println(“Up”);
// up = isPressed;
break;
case “Down”:
System.out.println(“Down”);
// down = isPressed;
break;
default:
break;
}
}
to send information to console. And I saw only “Jump” messages.
Well, I changed key-mapping and used numerical keys for moving character (2 - forward, 1 - left, 3 - right, 4 - back) - and they worked.
System I use is:
- jME: jMonkeyEngine SDK v3.2.4-stable-sdk1
- Java: 1.8.0_212; OpenJDK 64-Bit Server VM 25.212-b04
- OS: CentOS Linux 8
My question is - what is a problem? Is something wrong with jME, or system, or any drivers, or java, or may be my hands? But I finally stupidly copied code from example and saw the same behavior. And what can I read, recheck, try or fix.
I hope to any advice to continue studying jME. Thank you.