fs2open.github.com icon indicating copy to clipboard operation
fs2open.github.com copied to clipboard

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

Open naomimyselfandi opened this issue 4 years ago • 6 comments

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

naomimyselfandi avatar Apr 11 '21 22:04 naomimyselfandi

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.

ngld avatar Apr 11 '21 23:04 ngld

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?

naomimyselfandi avatar Apr 12 '21 01:04 naomimyselfandi

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.

JohnAFernandez avatar Apr 13 '21 03:04 JohnAFernandez

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.

MjnMixael avatar Sep 01 '21 15:09 MjnMixael

@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.

z64555 avatar Jul 14 '22 02:07 z64555

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

MjnMixael avatar Jul 14 '22 04:07 MjnMixael

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

Achille44 avatar Mar 27 '23 16:03 Achille44