[expression_editor] Handle navigation events in the controller.

Change-Id: I7f8f2846f7b7ac141e854215edd30e0c078a992c
This commit is contained in:
Léa Saviot
2017-12-14 15:28:35 +01:00
parent 8f6a27bee8
commit 5aa1946796

View File

@@ -25,7 +25,16 @@ void Controller::didBecomeFirstResponder() {
}
bool Controller::handleEvent(Ion::Events::Event event) {
return false;
bool returnValue = false;
if ((event == Ion::Events::Left && m_cursor.moveLeft())
|| (event == Ion::Events::Right && m_cursor.moveRight())
|| (event == Ion::Events::Up && m_cursor.moveUp())
|| (event == Ion::Events::Down && m_cursor.moveDown()))
{
returnValue = true;
}
m_view.cursorPositionChanged();
return returnValue;
}
}