Skip to content

Commit

Permalink
Traktor: Even more work on events and Edit control.
Browse files Browse the repository at this point in the history
  • Loading branch information
apistol78 committed Jun 7, 2024
1 parent e996221 commit b63ffad
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions code/Ui/Edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,26 +519,35 @@ void Edit::eventFocus(FocusEvent* event)
{
// Disable global KeyDown events while Edit got focus to prevent
// global hooks, such as ShortcutTable, to receive events.
Application::getInstance()->disableEventHandlers< KeyDownEvent >();
if (!m_modal)
{
Application::getInstance()->disableEventHandlers< KeyDownEvent >();
m_modal = true;
}
startTimer(500);
m_modal = true;
}
else
{
Application::getInstance()->enableEventHandlers< KeyDownEvent >();
if (m_modal)
{
Application::getInstance()->enableEventHandlers< KeyDownEvent >();
m_modal = false;
}
stopTimer();
deselect();
m_modal = false;
}
update();
}

void Edit::eventShow(ShowEvent* event)
{
if (!event->isVisible() && m_modal)
if (!event->isVisible())
{
Application::getInstance()->enableEventHandlers< KeyDownEvent >();
m_modal = false;
if (m_modal)
{
Application::getInstance()->enableEventHandlers< KeyDownEvent >();
m_modal = false;
}
}
}

Expand Down

0 comments on commit b63ffad

Please sign in to comment.