From c24de3c06915659ce6fcef5ff8a36d46268cfbf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Wed, 20 Dec 2017 13:58:31 +0100 Subject: [PATCH] [expression_editor] Handle ShiftLeft and ShiftRight events. Change-Id: Id416d1c95d023b8a0a4348a2570dd332615aa2b8 --- apps/expression_editor/controller.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/expression_editor/controller.cpp b/apps/expression_editor/controller.cpp index 40563a736..3be04567e 100644 --- a/apps/expression_editor/controller.cpp +++ b/apps/expression_editor/controller.cpp @@ -65,12 +65,17 @@ bool Controller::handleMoveEvent(Ion::Events::Event event) { return m_cursor.moveDown(); } if (event == Ion::Events::ShiftLeft) { - //TODO - return false; + // The cursor should never point to the main HorizontalLayout. + m_cursor.setPointedExpressionLayout(m_expressionLayout); + m_cursor.setPosition(ExpressionLayoutCursor::Position::Left); + m_cursor.setPositionInside(0); + return true; } if (event == Ion::Events::ShiftRight) { - //TODO - return false; + m_cursor.setPointedExpressionLayout(m_expressionLayout); + m_cursor.setPosition(ExpressionLayoutCursor::Position::Right); + m_cursor.setPositionInside(0); + return true; } return false; }