Open Fabrice-leterme opened 7 years ago
Hm... Can you express this in more detail please?
Try to include some of these clarifications:
![420px-romanian-keyboard-layout]
(https://cloud.githubusercontent.com/assets/2257439/25749153/d0c9fcfa-31ad-11e7-8535-076ae85c2d0d.png)
this is what I mean. other ports handle it pretty well
Okay, so it is about physical layout. I got it, but it may take time to bear an idea how to implement it in Java.
There is one significant difference between Java and platforms targeted by other source ports. On native platforms, the application can operate on the keyboard directly or through a layer that operates directly, or through a system-specific API, that operates directly. As Java is ideally platform-independent, neither of the way available. It should be possible using native library, but this is not really Java way.
What Java allows to get is not raw keycode from keyboard, but a letter, or a digit, or a symbol and/or modifier(s) like shift, ctrl and so on. It does map it to some internal java-ish integer value, but it has absolutely no relation to position on the keyboard.
The current implementation done for compatibility with vanilla DOOM default.cfg is very tricky: it emulates a set of keycodes of standard DOS keyboard interface, based on what we can get from Java the most raw way possible.
I will think more about it. I think, there should be some way in Java to try to acquire the layout of physical keyboard. If I'll find that way, I may add precalculated tables for various layouts to map them to DOS key codes.
WASD movement should change according to the keyboard layout,
for example WASD for me would be ZQSD.