2012-07-25 02:32:16 +00:00
|
|
|
#include <linux/input.h>
|
|
|
|
|
|
|
|
#include "recovery_ui.h"
|
|
|
|
#include "common.h"
|
|
|
|
#include "extendedcommands.h"
|
|
|
|
|
|
|
|
int device_handle_key(int key_code, int visible) {
|
|
|
|
if (visible) {
|
|
|
|
switch (key_code) {
|
|
|
|
case KEY_CAPSLOCK:
|
|
|
|
case KEY_DOWN:
|
|
|
|
case KEY_VOLUMEDOWN:
|
|
|
|
return HIGHLIGHT_DOWN;
|
2014-04-22 20:07:55 +00:00
|
|
|
|
2012-07-25 02:32:16 +00:00
|
|
|
case KEY_MENU:
|
|
|
|
return NO_ACTION;
|
2014-04-22 20:07:55 +00:00
|
|
|
|
2012-07-25 02:32:16 +00:00
|
|
|
case KEY_LEFTSHIFT:
|
|
|
|
case KEY_UP:
|
|
|
|
case KEY_VOLUMEUP:
|
|
|
|
return HIGHLIGHT_UP;
|
2014-04-22 20:07:55 +00:00
|
|
|
|
2012-07-25 02:32:16 +00:00
|
|
|
case KEY_HOMEPAGE:
|
2014-07-01 20:11:11 +00:00
|
|
|
case KEY_HOME:
|
2012-07-25 02:32:16 +00:00
|
|
|
case KEY_POWER:
|
|
|
|
case KEY_LEFTBRACE:
|
|
|
|
case KEY_ENTER:
|
|
|
|
case BTN_MOUSE:
|
|
|
|
case KEY_CAMERA:
|
|
|
|
case KEY_F21:
|
2014-04-22 20:07:55 +00:00
|
|
|
case KEY_SEND:
|
|
|
|
return SELECT_ITEM;
|
|
|
|
|
2012-07-25 02:32:16 +00:00
|
|
|
case KEY_END:
|
|
|
|
case KEY_BACKSPACE:
|
|
|
|
case KEY_SEARCH:
|
|
|
|
case KEY_BACK:
|
2014-04-22 20:07:55 +00:00
|
|
|
if (!ui_root_menu) {
|
|
|
|
return GO_BACK;
|
|
|
|
}
|
2012-07-25 02:32:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NO_ACTION;
|
|
|
|
}
|