summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2020-11-12 01:22:32 -0500
committerWilliam Wilgus <wilgus.william@gmail.com>2020-11-12 01:22:32 -0500
commit1a68856f52f1b6dc89863758404e54c744fcf53a (patch)
tree7db9e2dd14eab393918e509248bceaaa3073dd48
parent4e5499606bd34195cdee214221800a2462cdd7c1 (diff)
downloadrockbox-1a68856f52f1b6dc89863758404e54c744fcf53a.tar.gz
rockbox-1a68856f52f1b6dc89863758404e54c744fcf53a.tar.bz2
rockbox-1a68856f52f1b6dc89863758404e54c744fcf53a.zip
Rocker Add WPS and Tree Hotkey, button codes in debug menu
VolUp+VolDown becomes the wps and tree (file browser) hotkey Change-Id: I0cba96927420c318506bc0c15dabcb809cd81647
-rw-r--r--apps/keymaps/keymap-agptekrocker.c9
-rw-r--r--firmware/export/config/agptekrocker.h3
-rw-r--r--firmware/target/hosted/agptek/debug-agptek.c1
3 files changed, 10 insertions, 3 deletions
diff --git a/apps/keymaps/keymap-agptekrocker.c b/apps/keymaps/keymap-agptekrocker.c
index b27cb886b9..4d7139ffd5 100644
--- a/apps/keymaps/keymap-agptekrocker.c
+++ b/apps/keymaps/keymap-agptekrocker.c
@@ -22,7 +22,7 @@
#include "action.h"
#include "button.h"
#include "settings.h"
-
+#define BTN_VOL_COMBO (BUTTON_VOLUP | BUTTON_VOLDOWN)
/* {Action Code, Button code, Prereq button code } */
/*
@@ -84,6 +84,7 @@ static const struct button_mapping button_context_wps[] = {
*/
{ ACTION_STD_KEYLOCK, BUTTON_POWER, BUTTON_NONE },
+ { ACTION_WPS_HOTKEY, BTN_VOL_COMBO|BUTTON_REL, BTN_VOL_COMBO},
LAST_ITEM_IN_LIST
}; /* button_context_wps */
@@ -114,8 +115,9 @@ static const struct button_mapping button_context_list[] = {
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
}; /* button_context_list */
-#if 0
+
static const struct button_mapping button_context_tree[] = {
+ { ACTION_TREE_HOTKEY, BTN_VOL_COMBO|BUTTON_REL, BTN_VOL_COMBO},
/* ACTION_TREE_ROOT_INIT,
* ACTION_TREE_PGLEFT, optional
* ACTION_TREE_PGRIGHT, optional
@@ -129,7 +131,7 @@ static const struct button_mapping button_context_tree[] = {
*/
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
}; /* button_context_tree */
-#endif
+
static const struct button_mapping button_context_yesno[] = {
{ ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE },
@@ -230,6 +232,7 @@ const struct button_mapping* get_context_mapping(int context)
case CONTEXT_MAINMENU:
return button_context_mainmenu;
case CONTEXT_TREE:
+ return button_context_tree;
case CONTEXT_LIST:
return button_context_list;
diff --git a/firmware/export/config/agptekrocker.h b/firmware/export/config/agptekrocker.h
index 637898aaff..42abf4e9f0 100644
--- a/firmware/export/config/agptekrocker.h
+++ b/firmware/export/config/agptekrocker.h
@@ -61,3 +61,6 @@
/* Generic HiBy stuff */
#include "hibylinux.h"
+
+/* Define this if a programmable hotkey is mapped */
+#define HAVE_HOTKEY
diff --git a/firmware/target/hosted/agptek/debug-agptek.c b/firmware/target/hosted/agptek/debug-agptek.c
index d0ca613323..8ef0048945 100644
--- a/firmware/target/hosted/agptek/debug-agptek.c
+++ b/firmware/target/hosted/agptek/debug-agptek.c
@@ -70,6 +70,7 @@ bool dbg_hw_info(void)
#endif
btn = button_read_device();
+ lcd_putsf(0, line++, "btn: %d", btn);
lcd_update();
sleep(HZ/16);