mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-23 19:20:56 +00:00
Don't assume unmapped keycodes outside the extended ASCII range are unprintable
This commit is contained in:
parent
e230dcb8b2
commit
6e0f070cd1
@ -39,12 +39,14 @@ namespace MWInput
|
||||
&& MWBase::Environment::get().getWindowManager()->isConsoleMode())
|
||||
SDL_StopTextInput();
|
||||
|
||||
bool consumed = false;
|
||||
bool consumed = SDL_IsTextInputActive() && // Little trick to check if key is printable
|
||||
(!(SDLK_SCANCODE_MASK & arg.keysym.sym) &&
|
||||
(std::isprint(arg.keysym.sym) ||
|
||||
// Don't trust isprint for symbols outside the extended ASCII range
|
||||
(kc == MyGUI::KeyCode::None && arg.keysym.sym > 0xff)));
|
||||
if (kc != MyGUI::KeyCode::None && !mBindingsManager->isDetectingBindingState())
|
||||
{
|
||||
consumed = MWBase::Environment::get().getWindowManager()->injectKeyPress(kc, 0, arg.repeat);
|
||||
if (SDL_IsTextInputActive() && // Little trick to check if key is printable
|
||||
(!(SDLK_SCANCODE_MASK & arg.keysym.sym) && std::isprint(arg.keysym.sym)))
|
||||
if (MWBase::Environment::get().getWindowManager()->injectKeyPress(kc, 0, arg.repeat))
|
||||
consumed = true;
|
||||
mBindingsManager->setPlayerControlsEnabled(!consumed);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user