diff --git a/src/SFML/Window/Win32/InputImpl.cpp b/src/SFML/Window/Win32/InputImpl.cpp index fd02e10d6..122aef227 100644 --- a/src/SFML/Window/Win32/InputImpl.cpp +++ b/src/SFML/Window/Win32/InputImpl.cpp @@ -565,7 +565,8 @@ void InputImpl::ensureMappings() Keyboard::Scancode scan = static_cast(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; }