mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
Merge branch 'epsilon-appShortcuts' of https://github.com/0b101/Omega into 0b101-epsilon-appShortcuts
This commit is contained in:
@@ -8,6 +8,8 @@
|
|||||||
#include <ion/backlight.h>
|
#include <ion/backlight.h>
|
||||||
#include <poincare/preferences.h>
|
#include <poincare/preferences.h>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
}
|
}
|
||||||
@@ -218,6 +220,13 @@ bool AppsContainer::dispatchEvent(Ion::Events::Event event) {
|
|||||||
return didProcessEvent || alphaLockWantsRedraw;
|
return didProcessEvent || alphaLockWantsRedraw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static constexpr Ion::Events::Event switch_events[] = {
|
||||||
|
Ion::Events::ShiftSeven, Ion::Events::ShiftEight, Ion::Events::ShiftNine,
|
||||||
|
Ion::Events::ShiftFour, Ion::Events::ShiftFive, Ion::Events::ShiftSix,
|
||||||
|
Ion::Events::ShiftOne, Ion::Events::ShiftTwo, Ion::Events::ShiftThree,
|
||||||
|
Ion::Events::ShiftZero, Ion::Events::ShiftDot, Ion::Events::ShiftEE
|
||||||
|
};
|
||||||
|
|
||||||
bool AppsContainer::processEvent(Ion::Events::Event event) {
|
bool AppsContainer::processEvent(Ion::Events::Event event) {
|
||||||
// Warning: if the window is dirtied, you need to call window()->redraw()
|
// Warning: if the window is dirtied, you need to call window()->redraw()
|
||||||
if (event == Ion::Events::USBPlug) {
|
if (event == Ion::Events::USBPlug) {
|
||||||
@@ -242,6 +251,15 @@ bool AppsContainer::processEvent(Ion::Events::Event event) {
|
|||||||
switchTo(appSnapshotAtIndex(1));
|
switchTo(appSnapshotAtIndex(1));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
switchTo(appSnapshotAtIndex(i+1));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (event == Ion::Events::OnOff) {
|
if (event == Ion::Events::OnOff) {
|
||||||
suspend(true);
|
suspend(true);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -149,42 +149,27 @@ constexpr Event Arctangent = Event::ShiftKey(Keyboard::Key::Tangent);
|
|||||||
constexpr Event Equal = Event::ShiftKey(Keyboard::Key::Pi);
|
constexpr Event Equal = Event::ShiftKey(Keyboard::Key::Pi);
|
||||||
constexpr Event Lower = Event::ShiftKey(Keyboard::Key::Sqrt);
|
constexpr Event Lower = Event::ShiftKey(Keyboard::Key::Sqrt);
|
||||||
constexpr Event Greater = Event::ShiftKey(Keyboard::Key::Square);
|
constexpr Event Greater = Event::ShiftKey(Keyboard::Key::Square);
|
||||||
constexpr Event shiftans = Event::ShiftKey(Keyboard::Key::Ans);
|
|
||||||
constexpr Event shiftplus = Event::ShiftKey(Keyboard::Key::Plus);
|
|
||||||
constexpr Event shiftfois = Event::ShiftKey(Keyboard::Key::Multiplication);
|
|
||||||
constexpr Event shiftdiv = Event::ShiftKey(Keyboard::Key::Division);
|
|
||||||
constexpr Event shiftminus = Event::ShiftKey(Keyboard::Key::Minus);
|
|
||||||
constexpr Event shift1 = Event::ShiftKey(Keyboard::Key::One);
|
|
||||||
constexpr Event shift2 = Event::ShiftKey(Keyboard::Key::Two);
|
|
||||||
constexpr Event shift3 = Event::ShiftKey(Keyboard::Key::Three);
|
|
||||||
constexpr Event shift4 = Event::ShiftKey(Keyboard::Key::Four);
|
|
||||||
constexpr Event shift5 = Event::ShiftKey(Keyboard::Key::Five);
|
|
||||||
constexpr Event shift6 = Event::ShiftKey(Keyboard::Key::Six);
|
|
||||||
constexpr Event shift7 = Event::ShiftKey(Keyboard::Key::Seven);
|
|
||||||
constexpr Event shift8 = Event::ShiftKey(Keyboard::Key::Eight);
|
|
||||||
constexpr Event shift9 = Event::ShiftKey(Keyboard::Key::Nine);
|
|
||||||
constexpr Event shift0 = Event::ShiftKey(Keyboard::Key::Zero);
|
|
||||||
constexpr Event shiftdot = Event::ShiftKey(Keyboard::Key::Dot);
|
|
||||||
constexpr Event shiftee = Event::ShiftKey(Keyboard::Key::EE);
|
|
||||||
constexpr Event shiftlp = Event::ShiftKey(Keyboard::Key::LeftParenthesis);
|
|
||||||
constexpr Event shiftrp = Event::ShiftKey(Keyboard::Key::RightParenthesis);
|
|
||||||
|
|
||||||
constexpr Event BrightnessPlus = Event::ShiftKey(Keyboard::Key::Plus);
|
constexpr Event BrightnessPlus = Event::ShiftKey(Keyboard::Key::Plus);
|
||||||
constexpr Event BrightnessMinus = Event::ShiftKey(Keyboard::Key::Minus);
|
constexpr Event BrightnessMinus = Event::ShiftKey(Keyboard::Key::Minus);
|
||||||
|
|
||||||
constexpr Event DoubleParenthesis = Event::ShiftKey(Keyboard::Key::LeftParenthesis);
|
constexpr Event DoubleParenthesis = Event::ShiftKey(Keyboard::Key::LeftParenthesis);
|
||||||
|
|
||||||
constexpr Event ShiftSeven = Event::ShiftKey(Keyboard::Key::Seven);
|
constexpr Event ShiftZero = Event::ShiftKey(Keyboard::Key::Zero);
|
||||||
constexpr Event ShiftEight = Event::ShiftKey(Keyboard::Key::Eight);
|
constexpr Event ShiftDot = Event::ShiftKey(Keyboard::Key::Dot);
|
||||||
constexpr Event ShiftNine = Event::ShiftKey(Keyboard::Key::Nine);
|
constexpr Event ShiftEE = Event::PlainKey(Keyboard::Key::EE);
|
||||||
|
|
||||||
|
constexpr Event ShiftOne = Event::ShiftKey(Keyboard::Key::One);
|
||||||
|
constexpr Event ShiftTwo = Event::ShiftKey(Keyboard::Key::Two);
|
||||||
|
constexpr Event ShiftThree = Event::ShiftKey(Keyboard::Key::Three);
|
||||||
|
|
||||||
constexpr Event ShiftFour = Event::ShiftKey(Keyboard::Key::Four);
|
constexpr Event ShiftFour = Event::ShiftKey(Keyboard::Key::Four);
|
||||||
constexpr Event ShiftFive = Event::ShiftKey(Keyboard::Key::Five);
|
constexpr Event ShiftFive = Event::ShiftKey(Keyboard::Key::Five);
|
||||||
constexpr Event ShiftSix = Event::ShiftKey(Keyboard::Key::Six);
|
constexpr Event ShiftSix = Event::ShiftKey(Keyboard::Key::Six);
|
||||||
|
|
||||||
constexpr Event ShiftOne = Event::ShiftKey(Keyboard::Key::One);
|
constexpr Event ShiftSeven = Event::ShiftKey(Keyboard::Key::Seven);
|
||||||
constexpr Event ShiftTwo = Event::ShiftKey(Keyboard::Key::Two);
|
constexpr Event ShiftEight = Event::ShiftKey(Keyboard::Key::Eight);
|
||||||
constexpr Event ShiftThree = Event::ShiftKey(Keyboard::Key::Three);
|
constexpr Event ShiftNine = Event::ShiftKey(Keyboard::Key::Nine);
|
||||||
|
|
||||||
// Alpha
|
// Alpha
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user