[apps] Add Shift + EE to go to the settings

Before, EE go to the settings, because ShiftEE event wasn't correctly bound :
It was bound to a simple press of the key, and not to a Shift press.
This commit keep this behavior, but add the correct binding (Shift + EE).

This fix #194.
This commit is contained in:
Yaya.Cout
2022-03-30 19:21:44 +02:00
parent 202c273c67
commit 2ebc1bc22f
2 changed files with 10 additions and 1 deletions

View File

@@ -243,15 +243,18 @@ bool AppsContainer::processEvent(Ion::Events::Event event) {
}
return true;
}
// If key home or key back is pressed, we switch to the home app.
if (event == Ion::Events::Home || event == Ion::Events::Back) {
switchTo(appSnapshotAtIndex(0));
return true;
}
// If shift + Home are pressed, we switch to the first app.
if (event == Ion::Events::ShiftHome) {
switchTo(appSnapshotAtIndex(1));
return true;
}
// Iterate through the switch events to find the one that matches the event, if one match, switch to the app at the index of the switch event.
for(int i = 0; i < std::min((int) (sizeof(switch_events) / sizeof(Ion::Events::Event)), APPS_CONTAINER_SNAPSHOT_COUNT); i++) {
if (event == switch_events[i]) {
m_window.redraw(true);
@@ -260,6 +263,12 @@ bool AppsContainer::processEvent(Ion::Events::Event event) {
}
}
// Add EE shortcut to go to the settings (app number 12)
if (event == Ion::Events::EE) {
switchTo(appSnapshotAtIndex(12));
return true;
}
if (event == Ion::Events::OnOff) {
suspend(true);
return true;