[code] Escaping the input loop on a 'home' event should be handled by

the code app instead of the console controller to ensure to escape the
input loop even when the toolbox (or any modal) is displayed
This commit is contained in:
Émilie Feral
2018-05-22 15:39:21 +02:00
committed by LeaNumworks
parent 5cfe20ad15
commit da8286d3f7
4 changed files with 17 additions and 3 deletions

View File

@@ -87,6 +87,19 @@ App::App(Container * container, Snapshot * snapshot) :
{
}
bool App::handleEvent(Ion::Events::Event event) {
if (event == Ion::Events::Home && m_consoleController.inputRunLoopActive()) {
// We need to return true here because we want to actually exit from the
// input run loop, which requires ending a dispatchEvent cycle.
m_consoleController.askInputRunLoopTermination();
if (m_modalViewController.isDisplayingModal()) {
m_modalViewController.dismissModalViewController();
}
return true;
}
return false;
}
bool App::textInputDidReceiveEvent(TextInput * textInput, Ion::Events::Event event) {
const char * pythonText = Helpers::PythonTextForEvent(event);
if (pythonText != nullptr) {