MovingBlocks / Terasology

Terasology - open source voxel world
http://terasology.org
Apache License 2.0
3.64k stars 1.32k forks source link

Bug on trying to apply AZERTY input settings #5227

Open firasmestiri opened 3 months ago

firasmestiri commented 3 months ago

General Info

Terasology Launcher Version: 4.8.0 Terasology Version: 5.3.0 Operating System: Windows 10 Onboard / Dedicated Graphics: Nvidia GTX 1650ti Java Version: Version 8 361

What you were trying to do

I was trying to see the input settings to know how the controls work then I found the special keyboard section above, so i applied the AZERTY option since I have an AZERTY keyboard

What actually happened

After applying it, the controls changed as if it was QWERTY

How to reproduce

  1. Select Terasology version '5.3.0'
  2. Start Terasology
  3. Select gameplay 'Singleplayer'
  4. Create or load a game
  5. Start game
  6. Open the in game menu and go to the settings
  7. Choose Input settings
  8. Go over to the top section 'Special Keyboards' and apply AZERTY

Log details

No crash

Screenshots

image_2024-03-22_144317029

after applying the AZERTY option, the controls look like they're set to azerty correctly but when trying to move, the keybinds are different.

firasmestiri commented 1 month ago

for further investigation, and to be able to trace the problem, i think it may be beneficial to add an overlay text that shows the currently pressed key(s) to see if the problem is related to the key ids

i already tried to implement something like this but it doesn't seem to work

https://github.com/MovingBlocks/Terasology/blob/6077f5034ea08ef12da01b98c53cda3da4ce52f7/engine/src/main/java/org/terasology/engine/rendering/nui/layers/ingame/metrics/DebugOverlay.java#L33-L276

it can be done along the existing debug text

firasmestiri commented 1 month ago

i also forgot to mention, i analyzed the classes and code related to input management

the main class responsible for this issue is most likely in this class Bind commands

https://github.com/MovingBlocks/Terasology/blob/6077f5034ea08ef12da01b98c53cda3da4ce52f7/engine/src/main/java/org/terasology/engine/input/internal/BindCommands.java#L19-L24

the issue might be in the AZERTY() method specifically, and the keyid could be mistranslated or not correctly mapped

Cervator commented 1 month ago

Hi @firasmestiri and thank you for both the report and suggestions :-)

It can sometimes be a little easier to troubleshoot over on our Discord, but this may also work if patient.

AZERTY probably hasn't been touched for years at this point, and bugs do sneak in. I'm not sure which if any current maintainers even have an AZERTY keyboard to help test and validate things.

Are you able to run the game from source and maybe run it in debug mode to step through the code to see if it is simply skipping that method or something?