Fix #877 "Shift key stuck if both shifts switch keymap"

Adapted the patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=687332
This commit is contained in:
Michael Danilov 2019-12-23 14:20:26 +01:00
parent 1968f3d6e1
commit 75732c9387

View File

@ -357,7 +357,7 @@ osgGA::GUIEventAdapter* EventQueue::mouseButtonRelease(float x, float y, unsigne
osgGA::GUIEventAdapter* EventQueue::keyPress(int key, double time, int unmodifiedKey)
{
switch(key)
switch(unmodifiedKey)
{
case(GUIEventAdapter::KEY_Shift_L): _accumulateEventState->setModKeyMask(GUIEventAdapter::MODKEY_LEFT_SHIFT | _accumulateEventState->getModKeyMask()); break;
case(GUIEventAdapter::KEY_Shift_R): _accumulateEventState->setModKeyMask(GUIEventAdapter::MODKEY_RIGHT_SHIFT | _accumulateEventState->getModKeyMask()); break;
@ -403,7 +403,7 @@ osgGA::GUIEventAdapter* EventQueue::keyPress(int key, double time, int unmodifie
osgGA::GUIEventAdapter* EventQueue::keyRelease(int key, double time, int unmodifiedKey)
{
switch(key)
switch(unmodifiedKey)
{
case(GUIEventAdapter::KEY_Shift_L): _accumulateEventState->setModKeyMask(~GUIEventAdapter::MODKEY_LEFT_SHIFT & _accumulateEventState->getModKeyMask()); break;
case(GUIEventAdapter::KEY_Shift_R): _accumulateEventState->setModKeyMask(~GUIEventAdapter::MODKEY_RIGHT_SHIFT & _accumulateEventState->getModKeyMask()); break;