scp-fs2open / fs2open.github.com

Origin Repository for SCP FreeSpace 2 Open
https://www.hard-light.net/
Other
407 stars 163 forks source link

`hv.Key` is incorrect for non-QWERTY keyboard layouts #3378

Open naomimyselfandi opened 3 years ago

naomimyselfandi commented 3 years ago

Exactly what it says on the tin. For example, if an AZERTY user presses Q, hv.Key incorrectly reports A.

One easy place to see this is BTA's "The Texas Seven".

@MjnMixael

ngld commented 3 years ago

This issue has been discussed in more detail in #2225.

The main cause is that the engine only keeps track of scancodes which (by definition) ignore the keyboard layout since scancodes refer to the physical position of the key. To respect keyboard layouts, FSO would have to also keep track of the keycodes in addition to the current scancodes.

If you only want to fix hv.Key, it's probably possible to implement that in a reasonable time but proper support for keycodes would require a significant amount of effort since it would require rewriting a huge part of the input handling code. Proper handling of international keyboards has been implemented in controls6 but requires controls4 and 5 to be merged and needs to go through review and bug fixing.

naomimyselfandi commented 3 years ago

If you only want to fix hv.Key, it's probably possible to implement that in a reasonable time

That would actually be totally sufficient! The issue, basically, is that "The Texas Seven" becomes all but unplayable on a non-QWERTY keyboard, but in a totally unique way - even people who are used to remapping keys with F2 can't get past it. The mission asks you to enter commands in a "terminal", which draws its input from... you guessed it, hv.Key.

We've got some really clumsy hacks in place to try and improve the UX, but if it's possible to patch hv.Key so we don't have to, that'd be an incredible help!

On the other hand, we're currently aiming to release a major update (no new content, just bugfixes and the like) for our released campaigns targeting 21.2. Is there any chance of controls6 being ready by then?

JohnAFernandez commented 3 years ago

No, Controls 4-6 are going in after 21.2 . Chances would be high of some major uncaught bugs in 21.2 final if we merged them now.

MjnMixael commented 3 years ago

BtA's use-case for this issue has a work around in place. Does not need to be High Priority especially since it's linked to Controls 5/6 feature sets.

z64555 commented 2 years ago

@naomimyselfandi Since Controls6 was put in along with better keyboard localization support, is this issue still active?

@MjnMixael Likewise, at some point I think I talked to you about it on discord, but I'm not sure.

MjnMixael commented 2 years ago

We will have to test. Will get back to you.

Achille44 commented 1 year ago

FYI I still have this issue on FSO 23.0 with an AZERTY keyboard layout.