Fixed: ctrl+3 detected as KeyESCAPE when using keychar event

ryzom/ui/improvements
Nimetu 4 years ago
parent f7be62eb3d
commit 6b59fc0081

@ -2296,7 +2296,7 @@ namespace NLGUI
// Hide menu if the key is pushed // Hide menu if the key is pushed
// if ((eventDesc.getKeyEventType() == CEventDescriptorKey::keydown) && !_ModalStack.empty() && !eventDesc.getKeyAlt() && !eventDesc.getKeyCtrl() && !eventDesc.getKeyShift()) // if ((eventDesc.getKeyEventType() == CEventDescriptorKey::keydown) && !_ModalStack.empty() && !eventDesc.getKeyAlt() && !eventDesc.getKeyCtrl() && !eventDesc.getKeyShift())
// Hide menu (or popup menu) is ESCAPE pressed // Hide menu (or popup menu) is ESCAPE pressed
if( eventDesc.getKeyEventType() == CEventDescriptorKey::keychar && eventDesc.getChar() == NLMISC::KeyESCAPE ) if( eventDesc.getKeyEventType() == CEventDescriptorKey::keydown && eventDesc.getKey() == NLMISC::KeyESCAPE )
{ {
if( hasModal() ) if( hasModal() )
{ {
@ -2307,7 +2307,7 @@ namespace NLGUI
} }
// Manage "quit window" If the Key is ESCAPE, no captureKeyboard // Manage "quit window" If the Key is ESCAPE, no captureKeyboard
if( eventDesc.getKeyEventType() == CEventDescriptorKey::keychar && eventDesc.getChar() == NLMISC::KeyESCAPE ) if( eventDesc.getKeyEventType() == CEventDescriptorKey::keydown && eventDesc.getKey() == NLMISC::KeyESCAPE )
{ {
// Get the last escapable active top window. NB: this is ergonomically better. // Get the last escapable active top window. NB: this is ergonomically better.
CInterfaceGroup *win= getLastEscapableTopWindow(); CInterfaceGroup *win= getLastEscapableTopWindow();

Loading…
Cancel
Save