Avoid overwriting key to scancode mapping

This commit is contained in:
kimci86 2022-04-17 18:24:17 +02:00 committed by Lukas Dürrenberger
parent 914ae374ff
commit 7cf6d72633

View File

@ -565,7 +565,8 @@ void InputImpl::ensureMappings()
Keyboard::Scancode scan = static_cast<Keyboard::Scancode>(i);
UINT virtualKey = sfScanToVirtualKey(scan);
Keyboard::Key key = virtualKeyToSfKey(virtualKey);
m_keyToScancodeMapping[key] = scan;
if (key != Keyboard::Unknown && m_keyToScancodeMapping[key] == Keyboard::Scan::Unknown)
m_keyToScancodeMapping[key] = scan;
m_scancodeToKeyMapping[scan] = key;
}