MaxOw / RuneSlayer

RPG languages learning tool
38 stars 1 forks source link

Doesn't work with non-QWERTY layouts #2

Open turion opened 4 years ago

turion commented 4 years ago

The game implicitly assumes a QWERTY layout.

MaxOw commented 4 years ago

Wow. I haven't even thought about that possibility. Could you describe a little more what happens and what should happen. It would help me out a lot, otherwise I'll have figure out how to change layout on my own machine to test it. Unless the problem is simply with key mapping the you can change that in the Config.dhall. If that is the case and if you figure out mapping that are optimal for your layout we could add them commented out in the config and then anyone with the same layout could just remove the comments to quickly have proper bindings.

MaxOw commented 4 years ago

Alliteratively if the problem really is wrong key bindings as I've suspected I could make an option to make the bindings sort of positional? But I don't know if that would be optimal since many of the bindings try to be sort of mnemonics (like i to open inventory) so that could get messy as well. So I don't know which option is best here. That is ofc assuming that's the issue here.

MaxOw commented 4 years ago

Also note to self: I just remembered that the selector hint characters are currently hardcoded and optimized for QWERTY. I should make that configurable as well when fixing this issue.

turion commented 4 years ago

Let's assume a German layout (QWERTZ).

What happens: I press the key labelled y. Nothing happens. I press the key labelled z. The action associated to y happens.

Adding an alternate key binding seems like the best idea. But I don't know whether the tutorial will reflect the key bindings? Let me try to make a MR.

MaxOw commented 4 years ago

Ah, no. If I understood you correctly it seems that the problem is indeed on my side and changing keybindings wouldn't really help. I was thinking that maybe you had some crazy layout like Dvorak and then the directional vi like movement keys selected for QWERTY would be all over the place and that was the problem. In a way what we currently have here is indeed the "positional" solution that I was talking about that you don't specify a key but a position where the key would be on a QWERTY layout. And that is because I'm trusting GLFW to do the right thing here, that is if I get the event Key'Y I go user pressed y. I'll have to read up the docs to figure out what the correct procedure is here, like using scancode or maybe the Char event...

turion commented 4 years ago

I do also have a crazy layout. Neo, in fact. I'm not sure how GLFW handles key events, but that is something you can test with choosing a different layout.