summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzymon Dziok <b0hoon@o2.pl>2014-10-03 00:20:09 +0200
committerSzymon Dziok <b0hoon@o2.pl>2014-10-03 00:20:09 +0200
commit193ea0909d05607466ba8fb6448a0e21c322bf14 (patch)
tree6ffd098e6ef6c710ac73898409866c2c2dfcb33e
parent174523ab58a6bfede3d11ee38b9288e899188584 (diff)
downloadrockbox-193ea0909d05607466ba8fb6448a0e21c322bf14.tar.gz
rockbox-193ea0909d05607466ba8fb6448a0e21c322bf14.tar.bz2
rockbox-193ea0909d05607466ba8fb6448a0e21c322bf14.zip
Samsung yh820/yh92x: add HID keymaps.
Change-Id: I575e0e858aef0090d6864837d40a7b51e996ab43
-rw-r--r--apps/keymaps/keymap-yh8xx_yh9xx.c104
-rw-r--r--firmware/export/config/samsungyh820.h2
-rw-r--r--firmware/export/config/samsungyh920.h1
-rw-r--r--firmware/export/config/samsungyh925.h2
4 files changed, 107 insertions, 2 deletions
diff --git a/apps/keymaps/keymap-yh8xx_yh9xx.c b/apps/keymaps/keymap-yh8xx_yh9xx.c
index eb5c969cac..c2616c08c3 100644
--- a/apps/keymaps/keymap-yh8xx_yh9xx.c
+++ b/apps/keymaps/keymap-yh8xx_yh9xx.c
@@ -327,6 +327,96 @@ static const struct button_mapping button_context_radio[] = {
}; /* button_context_radio */
#endif
+#ifdef USB_ENABLE_HID
+static const struct button_mapping button_context_usb_hid[] = {
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_REC|BUTTON_FFWD|BUTTON_REL, BUTTON_REC|BUTTON_FFWD },
+ { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_REC|BUTTON_FFWD|BUTTON_REPEAT,BUTTON_REC|BUTTON_FFWD },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_REC|BUTTON_REW|BUTTON_REL, BUTTON_REC|BUTTON_REW },
+ { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_REC|BUTTON_REW|BUTTON_REPEAT, BUTTON_REC|BUTTON_REW },
+
+ LAST_ITEM_IN_LIST
+}; /* button_context_usb_hid */
+
+static const struct button_mapping button_context_usb_hid_mode_multimedia[] = {
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_REW|BUTTON_REL, BUTTON_REW },
+ { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_FFWD|BUTTON_REL, BUTTON_FFWD },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_multimedia */
+
+static const struct button_mapping button_context_usb_hid_mode_presentation[] = {
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_PLAY|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_REC|BUTTON_REL, BUTTON_REC },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_REW|BUTTON_REL, BUTTON_REW },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_FFWD|BUTTON_REL, BUTTON_FFWD },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_REW|BUTTON_REPEAT, BUTTON_REW },
+ { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_FFWD|BUTTON_REPEAT, BUTTON_FFWD },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_UP, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_presentation */
+
+static const struct button_mapping button_context_usb_hid_mode_browser[] = {
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_UP, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+
+ { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_LEFT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_LEFT|BUTTON_DOWN },
+
+ { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_REW|BUTTON_REL, BUTTON_REW },
+ { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_FFWD|BUTTON_REL, BUTTON_FFWD },
+ { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_REW|BUTTON_REPEAT, BUTTON_REW },
+ { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_FFWD|BUTTON_REPEAT, BUTTON_FFWD },
+ { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_REC|BUTTON_REL, BUTTON_REC },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_browser */
+
+#ifdef HAVE_USB_HID_MOUSE
+static const struct button_mapping button_context_usb_hid_mode_mouse[] = {
+ { ACTION_USB_HID_MOUSE_UP, BUTTON_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LEFT, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_LEFT_REP, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_RIGHT_REP, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_REW, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_REW|BUTTON_REL, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_FFWD, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_FFWD|BUTTON_REL, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_REC|BUTTON_UP, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_REC|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_REC|BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_REC|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_mouse */
+#endif
+#endif
+
const struct button_mapping* get_context_mapping(int context)
{
switch (context)
@@ -377,6 +467,20 @@ const struct button_mapping* get_context_mapping(int context)
case CONTEXT_FM:
return button_context_radio;
#endif
+#ifdef USB_ENABLE_HID
+ case CONTEXT_USB_HID:
+ return button_context_usb_hid;
+ case CONTEXT_USB_HID_MODE_MULTIMEDIA:
+ return button_context_usb_hid_mode_multimedia;
+ case CONTEXT_USB_HID_MODE_PRESENTATION:
+ return button_context_usb_hid_mode_presentation;
+ case CONTEXT_USB_HID_MODE_BROWSER:
+ return button_context_usb_hid_mode_browser;
+#ifdef HAVE_USB_HID_MOUSE
+ case CONTEXT_USB_HID_MODE_MOUSE:
+ return button_context_usb_hid_mode_mouse;
+#endif
+#endif
}
return button_context_standard;
}
diff --git a/firmware/export/config/samsungyh820.h b/firmware/export/config/samsungyh820.h
index 08bba1a910..74b5a77004 100644
--- a/firmware/export/config/samsungyh820.h
+++ b/firmware/export/config/samsungyh820.h
@@ -163,9 +163,9 @@
/* enable these for the experimental usb stack */
#define HAVE_USBSTACK
#define USE_ROCKBOX_USB
-/* todo - check */
#define USB_VENDOR_ID 0x04e8
#define USB_PRODUCT_ID 0x5023
+#define HAVE_USB_HID_MOUSE
/* Define this if you have adjustable CPU frequency */
#define HAVE_ADJUSTABLE_CPU_FREQ
diff --git a/firmware/export/config/samsungyh920.h b/firmware/export/config/samsungyh920.h
index f9d47008fb..9b378c8ffe 100644
--- a/firmware/export/config/samsungyh920.h
+++ b/firmware/export/config/samsungyh920.h
@@ -181,6 +181,7 @@
#define USE_ROCKBOX_USB
#define USB_VENDOR_ID 0x04e8
#define USB_PRODUCT_ID 0x5022
+#define HAVE_USB_HID_MOUSE
/* Define this if you have adjustable CPU frequency */
#define HAVE_ADJUSTABLE_CPU_FREQ
diff --git a/firmware/export/config/samsungyh925.h b/firmware/export/config/samsungyh925.h
index 26311cc5fb..45a2d5937e 100644
--- a/firmware/export/config/samsungyh925.h
+++ b/firmware/export/config/samsungyh925.h
@@ -170,9 +170,9 @@
/* enable these for the experimental usb stack */
#define HAVE_USBSTACK
#define USE_ROCKBOX_USB
-/* todo - check */
#define USB_VENDOR_ID 0x04e8
#define USB_PRODUCT_ID 0x5024
+#define HAVE_USB_HID_MOUSE
/* Define this if you have adjustable CPU frequency */
#define HAVE_ADJUSTABLE_CPU_FREQ