Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 1b8b1977 authored by Yumi Yukimura's avatar Yumi Yukimura Committed by Michael Bestas
Browse files

recovery_ui: Home key = First option, End key = Last option

Change-Id: Ie219aa46cc884b076af54c5c69bfa678dcbde2cc
parent e403de84
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -141,6 +141,11 @@ int Device::HandleMenuKey(int key, bool visible) {
    case BTN_DPAD_UP:
      return kHighlightUp;

    case KEY_HOME:
      return kHighlightFirst;
    case KEY_END:
      return kHighlightLast;

    case KEY_PAGEUP:
    case KEY_SCROLLUP:
      return kScrollUp;
@@ -156,7 +161,6 @@ int Device::HandleMenuKey(int key, bool visible) {
    case BTN_START:
      return kInvokeItem;

    case KEY_HOME:
    case KEY_HOMEPAGE:
    case KEY_LEFTMETA:
    case KEY_RIGHTMETA:
+2 −0
Original line number Diff line number Diff line
@@ -41,6 +41,8 @@ class Device {
  static constexpr const int kScrollUp = -8;
  static constexpr const int kScrollDown = -9;
  static constexpr const int kRefresh = -10;
  static constexpr const int kHighlightFirst = -11;
  static constexpr const int kHighlightLast = -12;

  // ENTER vs REBOOT: The latter will trigger a reboot that goes through bootloader, which allows
  // using a new bootloader / recovery image if applicable. For example, REBOOT_RESCUE goes from
+7 −1
Original line number Diff line number Diff line
@@ -1393,7 +1393,7 @@ void ScreenRecoveryUI::ShowFile(FILE* fp) {
          continue;
        }
        if (evt.key() == KEY_POWER || evt.key() == KEY_ENTER || evt.key() == KEY_BACKSPACE ||
            evt.key() == KEY_BACK || evt.key() == KEY_HOME || evt.key() == KEY_HOMEPAGE ||
            evt.key() == KEY_BACK || evt.key() == KEY_HOMEPAGE ||
            evt.key() == KEY_ESC || evt.key() == KEY_LEFTMETA || evt.key() == KEY_RIGHTMETA) {
          return;
        } else if (evt.key() == KEY_UP || evt.key() == KEY_VOLUMEUP || evt.key() == KEY_SCROLLUP ||
@@ -1622,6 +1622,12 @@ size_t ScreenRecoveryUI::ShowMenu(std::unique_ptr<Menu>&& menu, bool menu_only,
        case Device::kHighlightDown:
          selected = SelectMenu(++selected);
          break;
        case Device::kHighlightFirst:
          selected = SelectMenu(0);
          break;
        case Device::kHighlightLast:
          selected = SelectMenu(menu_->ItemsCount() - 1);
          break;
        case Device::kScrollUp:
          selected = ScrollMenu(-1);
          break;