Hi,
I've added support for the neo2 keyboard layout to oc.
Git patch here
Not sure how many people will profit from this, but after I saw dvorak in there I thought I'd try to smash it in there.
greetings
/ker
I've added support for the neo2 keyboard layout to oc.
Git patch here
Not sure how many people will profit from this, but after I saw dvorak in there I thought I'd try to smash it in there.
greetings
/ker
Hi ker, thank you for your effort. You surely got into the active community fast! So, welcome to the OC community! :-)
However, I think that this doesn't make much sense. DVORAK was added in times where the key configuration feature wasn't implemented yet, now it's just in because nobody bothered to remove it again. We already talked about the issue with the key configurations as there were also some French people complaining that it doesn't work for they AZERTY keyboard layout. We resolved that the next wise thing to do is to implement the keyboard controls independently of the chosen keyboard layout. So the A key for example would be always the key that is left to the CAPS LOCK key regardless of which keyboard layout one has.
Unfortunately, noone got around to do that yet, mainly because I think nobody does know exactly how to do this.
However, I think that this doesn't make much sense. DVORAK was added in times where the key configuration feature wasn't implemented yet, now it's just in because nobody bothered to remove it again. We already talked about the issue with the key configurations as there were also some French people complaining that it doesn't work for they AZERTY keyboard layout. We resolved that the next wise thing to do is to implement the keyboard controls independently of the chosen keyboard layout. So the A key for example would be always the key that is left to the CAPS LOCK key regardless of which keyboard layout one has.
Unfortunately, noone got around to do that yet, mainly because I think nobody does know exactly how to do this.
> DVORAK was added in times where the key configuration feature wasn't implemented yet, now it's just in because nobody bothered to remove it again.
Please keep as long as layout-independent controls are not yet available :)
> Unfortunately, noone got around to do that yet, mainly because I think nobody does know exactly how to do this.
What? Engine support for Windows is already done (supply scan codes in hex format as $%x). I believe it's also implemented for X11. I don't know if they share the same scan codes though. Didn't we do that at the last OC release meeting?
for gtk there's nothing in master. is there a branch I could have a look at?
> I believe it's also implemented for X11. I don't know if they share the same scan codes though. Didn't we do that at the last OC release meeting?
Yes, but as we have learned at said meeting, the scancodes are different.
So the solution we will aim for is to have a function with #ifdef each for windows and linux that translates the OC-internal keycodes into platform-dependent keycodes?
Edit: Wouldn't it make sense then to always specify keys like "A" "D" etc. in the PlayerControls.txt and internally translate those into keycodes? Otherwise the person who edits the PlayerControls.txt always has to know which (OC-)keycode is supposed to be which key.
Edit: Wouldn't it make sense then to always specify keys like "A" "D" etc. in the PlayerControls.txt and internally translate those into keycodes? Otherwise the person who edits the PlayerControls.txt always has to know which (OC-)keycode is supposed to be which key.
Hmm, diving deeper into that matter, how can the keyboard scancodes (not the virtual key codes) be different between linux and windows? I mean, that should be the code that comes from the hardware, from the keyboard, no?
Yes, specifying your keys in terms of an US layout keyboard and translating them would definitely make a lot of sense. I think we discussed that at the meeting but didn't end up implementing it. It wouldn't be that much work actually.
The feature to supply scan codes would remain for people who want to specify keys not present on a US keyboard.
The feature to supply scan codes would remain for people who want to specify keys not present on a US keyboard.
The engine support is backwards, though - it converts scancodes to virtual codes, and compares the latter. While this is the only feasible way to implement the feature for one platform only, we really should make the internal format be the scancodes, and convert the text representation in the configuration into that - or store the scancodes directly in case the user configured them. Having the text representation be what's printed on a DE or US keyboard on the key with that scancode certainly makes sense. We should probably implement this for Windows and Linux asap and let Mac catch up. See also http://bugs.openclonk.org/view.php?id=729
it's actually rather trivial if you just want the keys for control.
but it would mess up entering text.
having both possible requires a switch to the us-layout on startup, creating a custom map of all useful keys, and switching back.
from then on, for control keys, the map has to be queried for every key event
but it would mess up entering text.
having both possible requires a switch to the us-layout on startup, creating a custom map of all useful keys, and switching back.
from then on, for control keys, the map has to be queried for every key event
Text input is done separately anyway, because it might involve complicated shift handlings, modifier keys for accents, IMEs, etc.. For Windows, there's a different window message for text character input (WM_CHAR vs WM_KEYDOWN). I don't know about the other systems but I'm sure the OS provides character conversion there as well.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill