-
Notifications
You must be signed in to change notification settings - Fork 0
/
recovery_keys.c
38 lines (30 loc) · 812 Bytes
/
recovery_keys.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <linux/input.h>
#include "recovery_ui.h"
#include "common.h"
#include "extendedcommands.h"
int device_toggle_display(volatile char* key_pressed, int key_code) {
return 0;
}
int device_handle_key(int key_code, int visible) {
if (visible) {
switch (key_code) {
case KEY_3:
case KEY_ENTER:
case KEY_SEARCH:
return HIGHLIGHT_DOWN;
case KEY_4:
case KEY_HOME:
case KEY_MENU:
return HIGHLIGHT_UP;
case KEY_2:
case KEY_POWER:
return SELECT_ITEM;
case KEY_1:
case KEY_ESC:
if (ui_menu_level > 0) {
return GO_BACK;
}
}
}
return NO_ACTION;
}