Skip to content

Commit 83b0fa3

Browse files
appsforartistsbluca
authored andcommitted
boot: cover for hardware keys on phones/tablets
The patch is originally from Brenton Simpson, I (Lennart) just added some comments and rebased it. I didn't test this, but the patch looks so obviously right to me, that I think we should just merge it, instead of delaying this further. In the worst case noone notices, in the best case this makes sd-boot work reasonably nicely on devices that only have a hadware power key + volume rocker. Fixes: #30598 Replaces: #31135 (cherry picked from commit 2fda6f5) (cherry picked from commit 71de25f) (cherry picked from commit 80c7571)
1 parent 73c7af8 commit 83b0fa3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/boot/efi/boot.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -826,13 +826,15 @@ static bool menu_run(
826826

827827
switch (key) {
828828
case KEYPRESS(0, SCAN_UP, 0):
829+
case KEYPRESS(0, SCAN_VOLUME_UP, 0): /* Handle phones/tablets that only have a volume up/down rocker + power key (and otherwise just touchscreen input) */
829830
case KEYPRESS(0, 0, 'k'):
830831
case KEYPRESS(0, 0, 'K'):
831832
if (idx_highlight > 0)
832833
idx_highlight--;
833834
break;
834835

835836
case KEYPRESS(0, SCAN_DOWN, 0):
837+
case KEYPRESS(0, SCAN_VOLUME_DOWN, 0):
836838
case KEYPRESS(0, 0, 'j'):
837839
case KEYPRESS(0, 0, 'J'):
838840
if (idx_highlight < config->n_entries-1)
@@ -870,9 +872,10 @@ static bool menu_run(
870872

871873
case KEYPRESS(0, 0, '\n'):
872874
case KEYPRESS(0, 0, '\r'):
873-
case KEYPRESS(0, SCAN_F3, 0): /* EZpad Mini 4s firmware sends malformed events */
874-
case KEYPRESS(0, SCAN_F3, '\r'): /* Teclast X98+ II firmware sends malformed events */
875+
case KEYPRESS(0, SCAN_F3, 0): /* EZpad Mini 4s firmware sends malformed events */
876+
case KEYPRESS(0, SCAN_F3, '\r'): /* Teclast X98+ II firmware sends malformed events */
875877
case KEYPRESS(0, SCAN_RIGHT, 0):
878+
case KEYPRESS(0, SCAN_SUSPEND, 0): /* Handle phones/tablets with only a power key + volume up/down rocker (and otherwise just touchscreen input) */
876879
exit = true;
877880
break;
878881

0 commit comments

Comments
 (0)