summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2017-04-27 11:36:40 +0200
committerMarcin Bukat <marcin.bukat@gmail.com>2018-06-12 10:31:14 +0200
commitd55680993df9b6743506814d98b5cc1859828f8a (patch)
tree054dc45425fa1a6863f154b484036f26cc3ac13f /uisimulator
parentbeef52c5f0832e2c36bb1523b51eb8721f851db5 (diff)
downloadrockbox-d55680993df9b6743506814d98b5cc1859828f8a.tar.gz
rockbox-d55680993df9b6743506814d98b5cc1859828f8a.tar.bz2
rockbox-d55680993df9b6743506814d98b5cc1859828f8a.zip
Agptek Rocker: Initial commit
Change-Id: I26b51106c7b1c36a603fba6d521e917d79b5a95b
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/bitmaps/UI-agptekrocker.bmpbin0 -> 282858 bytes
-rw-r--r--uisimulator/buttonmap/SOURCES2
-rw-r--r--uisimulator/buttonmap/agptek-rocker.c80
3 files changed, 82 insertions, 0 deletions
diff --git a/uisimulator/bitmaps/UI-agptekrocker.bmp b/uisimulator/bitmaps/UI-agptekrocker.bmp
new file mode 100644
index 0000000000..36a215f234
--- /dev/null
+++ b/uisimulator/bitmaps/UI-agptekrocker.bmp
Binary files differ
diff --git a/uisimulator/buttonmap/SOURCES b/uisimulator/buttonmap/SOURCES
index 6acbd94624..901b4ebd2f 100644
--- a/uisimulator/buttonmap/SOURCES
+++ b/uisimulator/buttonmap/SOURCES
@@ -83,5 +83,7 @@ samsung-ypr0.c
creative-zen.c
#elif CONFIG_KEYPAD == SONY_NWZA860_PAD
sony-nwza860.c
+#elif CONFIG_KEYPAD == AGPTEK_ROCKER_PAD
+agptek-rocker.c
#endif
#endif /* SIMULATOR */
diff --git a/uisimulator/buttonmap/agptek-rocker.c b/uisimulator/buttonmap/agptek-rocker.c
new file mode 100644
index 0000000000..ef7abd9879
--- /dev/null
+++ b/uisimulator/buttonmap/agptek-rocker.c
@@ -0,0 +1,80 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2013 by Amaury Pouly
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+
+#include <SDL.h>
+#include "button.h"
+#include "buttonmap.h"
+
+int key_to_button(int keyboard_button)
+{
+ int new_btn = BUTTON_NONE;
+ switch (keyboard_button)
+ {
+ case SDLK_KP4:
+ case SDLK_LEFT:
+ new_btn = BUTTON_LEFT;
+ break;
+ case SDLK_KP6:
+ case SDLK_RIGHT:
+ new_btn = BUTTON_RIGHT;
+ break;
+ case SDLK_KP8:
+ case SDLK_UP:
+ new_btn = BUTTON_UP;
+ break;
+ case SDLK_KP2:
+ case SDLK_DOWN:
+ new_btn = BUTTON_DOWN;
+ break;
+ case SDLK_ESCAPE:
+ new_btn = BUTTON_POWER;
+ break;
+ case SDLK_KP_PLUS:
+ case SDLK_EQUALS:
+ new_btn = BUTTON_VOLUP;
+ break;
+ case SDLK_KP_MINUS:
+ case SDLK_MINUS:
+ new_btn = BUTTON_VOLDOWN;
+ break;
+ case SDLK_KP_ENTER:
+ case SDLK_RETURN:
+ case SDLK_SPACE:
+ case SDLK_INSERT:
+ case SDLK_KP5:
+ new_btn = BUTTON_SELECT;
+ break;
+ }
+ return new_btn;
+}
+
+struct button_map bm[] = {
+ { SDLK_LEFT, 38, 296, 20, "Left" },
+ { SDLK_RIGHT, 146, 295, 20, "Right" },
+ { SDLK_UP, 93, 241, 20, "Up" },
+ { SDLK_DOWN, 93, 348, 20, "Down" },
+ { SDLK_ESCAPE, 2, 45, 20, "Power" },
+ { SDLK_RETURN, 93, 295, 40, "Select" },
+ { SDLK_KP_MINUS, 182, 100, 30, "Volume -" },
+ { SDLK_KP_PLUS, 182, 45, 30, "Volume +" },
+ { 0, 0, 0, 0, "None" }
+};