You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The way that keyboard mappings are saved in Uru right now is a bit of a problem, particularly with regards to different keyboard layouts, cross-platform support, localization, and circular dependencies.
Currently, a key is mapped to a translated string that corresponds to a Win32 Virtual Key:
for (int i = 0; keyConvert[i].fVKey != 0xffffffff; i++)
{
if (keyConvert[i].fVKey == vk)
return (keyConvert[i].fKeyName);
}
return nil;
}
The most surface-level problem is that this adds a PubUtilLib/plResManager/plLocalization dependency to NucleusLib/pnInputCore to look up the active language.
Beyond that, for cross-platform input, we are hoping to map the keyboard keys to the USB HID specification, which is different than the Win32 Virtual Key values. KEY_A in the USB HID spec does not refer to the key labelled A but rather to the position of the "A" key on a US QWERTY keyboard.
That of itself would be fine, except that the current user keymaps use "A" to refer to the key labelled A, and also potentially use "Maj+Échap" to refer to a Shift+Escape combination.
Thoughts
Store all (future) keymaps using USB HID terminology
There is no need for the keymap itself to be stored in the user's locale.
We still need key translations at some level
To correctly display localized key names in the game UI, we need to know the label for a key. On Windows we can probably map it back to a Virtual Key fairly easily, but on Linux I'm assuming this is going to turn into the worst parts of X11 keymap stuff.
What can we do about existing keymaps?
Part of me thinks the easiest solution here is detecting them, trashing them, and showing the in-game keyboard config UI on launch, but that's obviously not ideal.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The way that keyboard mappings are saved in Uru right now is a bit of a problem, particularly with regards to different keyboard layouts, cross-platform support, localization, and circular dependencies.
Currently, a key is mapped to a translated string that corresponds to a Win32 Virtual Key:
Plasma/Sources/Plasma/NucleusLib/pnInputCore/plInputMap.cpp
Lines 520 to 549 in f66c83a
The most surface-level problem is that this adds a
PubUtilLib/plResManager/plLocalization
dependency toNucleusLib/pnInputCore
to look up the active language.Beyond that, for cross-platform input, we are hoping to map the keyboard keys to the USB HID specification, which is different than the Win32 Virtual Key values.
KEY_A
in the USB HID spec does not refer to the key labelled A but rather to the position of the "A" key on a US QWERTY keyboard.That of itself would be fine, except that the current user keymaps use "A" to refer to the key labelled A, and also potentially use "Maj+Échap" to refer to a Shift+Escape combination.
Thoughts
Store all (future) keymaps using USB HID terminology
There is no need for the keymap itself to be stored in the user's locale.
We still need key translations at some level
To correctly display localized key names in the game UI, we need to know the label for a key. On Windows we can probably map it back to a Virtual Key fairly easily, but on Linux I'm assuming this is going to turn into the worst parts of X11 keymap stuff.
What can we do about existing keymaps?
Part of me thinks the easiest solution here is detecting them, trashing them, and showing the in-game keyboard config UI on launch, but that's obviously not ideal.
Beta Was this translation helpful? Give feedback.
All reactions