Better fix for numerical enter (issue #427)

Should now work everywhere, not only in the editor.
master
krzys-h 2015-03-18 21:10:47 +01:00
parent a6e15a8cd9
commit 92ea770121
2 changed files with 6 additions and 1 deletions

View File

@ -1044,6 +1044,9 @@ Event CApplication::ProcessSystemEvent()
event.key.key = m_private->currentEvent.key.keysym.sym; event.key.key = m_private->currentEvent.key.keysym.sym;
event.key.unicode = m_private->currentEvent.key.keysym.unicode; event.key.unicode = m_private->currentEvent.key.keysym.unicode;
event.kmodState = m_private->currentEvent.key.keysym.mod; event.kmodState = m_private->currentEvent.key.keysym.mod;
if(event.key.key == KEY(KP_ENTER))
event.key.key = KEY(RETURN);
} }
else if ( (m_private->currentEvent.type == SDL_MOUSEBUTTONDOWN) || else if ( (m_private->currentEvent.type == SDL_MOUSEBUTTONDOWN) ||
(m_private->currentEvent.type == SDL_MOUSEBUTTONUP) ) (m_private->currentEvent.type == SDL_MOUSEBUTTONUP) )
@ -1213,6 +1216,8 @@ Event CApplication::CreateVirtualEvent(const Event& sourceEvent)
virtualEvent.type = EVENT_NULL; virtualEvent.type = EVENT_NULL;
} }
m_input->EventProcess(virtualEvent);
return virtualEvent; return virtualEvent;
} }

View File

@ -450,7 +450,7 @@ bool CEdit::EventProcess(const Event &event)
return true; return true;
} }
if ( !bControl && ( event.key.key == KEY(RETURN) || event.key.key == KEY(KP_ENTER) ) ) if ( event.key.key == KEY(RETURN) && !bControl )
{ {
Insert('\n'); Insert('\n');
SendModifEvent(); SendModifEvent();