You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

46 lines
1.0 KiB

  1. #include <linux/input.h>
  2. #include "recovery_ui.h"
  3. #include "common.h"
  4. #include "extendedcommands.h"
  5. int device_handle_key(int key_code, int visible) {
  6. if (visible) {
  7. switch (key_code) {
  8. case KEY_CAPSLOCK:
  9. case KEY_DOWN:
  10. case KEY_VOLUMEDOWN:
  11. return HIGHLIGHT_DOWN;
  12. case KEY_MENU:
  13. return NO_ACTION;
  14. case KEY_LEFTSHIFT:
  15. case KEY_UP:
  16. case KEY_VOLUMEUP:
  17. return HIGHLIGHT_UP;
  18. case KEY_HOMEPAGE:
  19. case KEY_HOME:
  20. case KEY_POWER:
  21. case KEY_LEFTBRACE:
  22. case KEY_ENTER:
  23. case BTN_MOUSE:
  24. case KEY_CAMERA:
  25. case KEY_F21:
  26. case KEY_SEND:
  27. return SELECT_ITEM;
  28. case KEY_END:
  29. case KEY_BACKSPACE:
  30. case KEY_SEARCH:
  31. case KEY_BACK:
  32. if (!ui_root_menu) {
  33. return GO_BACK;
  34. }
  35. }
  36. }
  37. return NO_ACTION;
  38. }