mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[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:
@@ -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;
|
||||
|
||||
@@ -171,7 +171,7 @@ constexpr Event DoubleParenthesis = Event::ShiftKey(Keyboard::Key::LeftParenthes
|
||||
|
||||
constexpr Event ShiftZero = Event::ShiftKey(Keyboard::Key::Zero);
|
||||
constexpr Event ShiftDot = Event::ShiftKey(Keyboard::Key::Dot);
|
||||
constexpr Event ShiftEE = Event::PlainKey(Keyboard::Key::EE);
|
||||
constexpr Event ShiftEE = Event::ShiftKey(Keyboard::Key::EE);
|
||||
|
||||
constexpr Event ShiftOne = Event::ShiftKey(Keyboard::Key::One);
|
||||
constexpr Event ShiftTwo = Event::ShiftKey(Keyboard::Key::Two);
|
||||
|
||||
Reference in New Issue
Block a user