forked from teamnwah/openmw-tes3coop
Pass repeat key events to the GUI
For example, one can scroll to the last element in a list by holding down the 'Down Arrow' key.
This commit is contained in:
parent
b22fedf4ae
commit
e7ad012977
2 changed files with 7 additions and 7 deletions
|
@ -679,6 +679,9 @@ namespace MWInput
|
||||||
bool guiFocus = MyGUI::InputManager::getInstance().injectKeyPress(MyGUI::KeyCode::Enum(kc), 0);
|
bool guiFocus = MyGUI::InputManager::getInstance().injectKeyPress(MyGUI::KeyCode::Enum(kc), 0);
|
||||||
setPlayerControlsEnabled(!guiFocus);
|
setPlayerControlsEnabled(!guiFocus);
|
||||||
}
|
}
|
||||||
|
if (arg.repeat)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!mControlsDisabled && !consumed)
|
if (!mControlsDisabled && !consumed)
|
||||||
mInputBinder->keyPressed (arg);
|
mInputBinder->keyPressed (arg);
|
||||||
mJoystickLastUsed = false;
|
mJoystickLastUsed = false;
|
||||||
|
|
|
@ -85,15 +85,12 @@ InputWrapper::InputWrapper(SDL_Window* window, osg::ref_ptr<osgViewer::Viewer> v
|
||||||
mMouseListener->mouseReleased(evt.button, evt.button.button);
|
mMouseListener->mouseReleased(evt.button, evt.button.button);
|
||||||
break;
|
break;
|
||||||
case SDL_KEYDOWN:
|
case SDL_KEYDOWN:
|
||||||
if (!evt.key.repeat)
|
|
||||||
{
|
|
||||||
mKeyboardListener->keyPressed(evt.key);
|
mKeyboardListener->keyPressed(evt.key);
|
||||||
|
|
||||||
if (!isModifierHeld(KMOD_ALT) && evt.key.keysym.sym >= SDLK_F1 && evt.key.keysym.sym <= SDLK_F12)
|
if (!isModifierHeld(KMOD_ALT) && evt.key.keysym.sym >= SDLK_F1 && evt.key.keysym.sym <= SDLK_F12)
|
||||||
{
|
{
|
||||||
mViewer->getEventQueue()->keyPress(osgGA::GUIEventAdapter::KEY_F1 + (evt.key.keysym.sym - SDLK_F1));
|
mViewer->getEventQueue()->keyPress(osgGA::GUIEventAdapter::KEY_F1 + (evt.key.keysym.sym - SDLK_F1));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case SDL_KEYUP:
|
case SDL_KEYUP:
|
||||||
|
|
Loading…
Reference in a new issue