Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#10468 - USB HID: Show keypad mode on screen

Attached to Project: Rockbox
Opened by Tomer Shalev (tomers) - Sunday, 26 July 2009, 09:30 GMT+2
Last edited by Tomer Shalev (tomers) - Wednesday, 30 September 2009, 15:26 GMT+2
Task Type Patches
Category Drivers
Status Closed
Assigned To Tomer Shalev (tomers)
Player Type All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

This patch add support for changing keypad mapping to keys sent to the host computer while the DAP is connected through USB.
The user can iterate over the different keypad modes by pressing a key (e200: REC key). The different modes are:
* Media Player (Control volume, Pause/Play, Stop, Next/Previous tracks)
* PowerPoint (Start Presentation, Next/Previous slide, Black/White screen, etc)
* Acrobat Reader (Next/Previous Page/Screen, Full Screen, Scroll Up/Down)

Additional modes can be easily added.

The current mode will be shown on screen (tested on e200 - need further testing on different platforms).
   usb_hid_show_keymap.diff (48.1 KiB)
 apps/screens.c                    |  238 +++++++++++++++++++++++++++-----------
 apps/action.h                     |   22 ++-
 apps/keymaps/keymap-ondavx747.c   |   14 +-
 apps/keymaps/keymap-c100.c        |   17 +-
 apps/keymaps/keymap-gigabeat-s.c  |   53 ++++----
 apps/keymaps/keymap-c200.c        |   24 ++-
 apps/keymaps/keymap-e200.c        |   28 ++--
 apps/keymaps/keymap-sa9200.c      |   41 +++---
 apps/keymaps/keymap-touchscreen.c |   23 ++-
 apps/keymaps/keymap-clip.c        |   28 ++--
 apps/keymaps/keymap-h10.c         |   39 +++---
 apps/keymaps/keymap-ipod.c        |   42 +++---
 apps/keymaps/keymap-mr100.c       |   51 +++++---
 apps/keymaps/keymap-hdd1630.c     |   32 ++---
 firmware/usbstack/usb_hid.c       |   16 +-
 15 files changed, 433 insertions(+), 235 deletions(-)

This task depends upon

Closed by  Tomer Shalev (tomers)
Wednesday, 30 September 2009, 15:26 GMT+2
Reason for closing:  Accepted
Additional comments about closing:  Committed in r22852-22856
Comment by Paul Louden (Llorean) - Sunday, 26 July 2009, 10:45 GMT+2
Why not allow the mode to be set in a normal settings menu, so that *all* buttons are available while in USB mode?

This is especially helpful since many players don't have a record button, and so have even less available buttons to be able to spare one for this.
Comment by Tomer Shalev (tomers) - Monday, 27 July 2009, 08:41 GMT+2
> Why not allow the mode to be set in a normal settings menu, so that *all* buttons are available while in USB mode?
I think this is a good remark. I've implemented a system setting for this feature, and a manual section for it (currently enabled only in e200 - should define option USB_ENABLE_HID in manual/platform/*.tex where relevant).

Attached patch contains these additions.
   usb_hid_show_keymap.diff (48.9 KiB)
 apps/screens.c                              |  240 ++++++++++++++++++++--------
 apps/action.h                               |   22 +-
 apps/lang/english.lang                      |   56 ++++++
 apps/settings.h                             |    3 
 apps/menus/settings_menu.c                  |    6 
 apps/settings_list.c                        |    6 
 apps/keymaps/keymap-ondavx747.c             |   14 -
 apps/keymaps/keymap-c100.c                  |   17 +
 apps/keymaps/keymap-gigabeat-s.c            |   53 +++---
 apps/keymaps/keymap-c200.c                  |   24 +-
 apps/keymaps/keymap-e200.c                  |   28 ++-
 apps/keymaps/keymap-sa9200.c                |   41 ++--
 apps/keymaps/keymap-touchscreen.c           |   23 ++
 apps/keymaps/keymap-clip.c                  |   28 ++-
 apps/keymaps/keymap-h10.c                   |   39 ++--
 apps/keymaps/keymap-ipod.c                  |   42 ++--
 apps/keymaps/keymap-hdd1630.c               |   32 ++-
 firmware/usbstack/usb_hid.c                 |   16 +
 manual/platform/e200.tex                    |    1 
 manual/configure_rockbox/system_options.tex |   26 +++
 20 files changed, 501 insertions(+), 216 deletions(-)

Comment by Frank Gevaerts (fg) - Saturday, 01 August 2009, 16:02 GMT+2
I must say I'm not very comfortable with directly naming and supporting proprietary applications. Do other similar applications use the same keys? If so, how about naming the modes "Presentation" and "Document viewer"?

More generally, I'm not sure how far we should take this built-in HID mode. Personally, I think the remote_control plugin is the proper place for all this.
Comment by Will Hauck (moonscapex) - Sunday, 13 September 2009, 20:55 GMT+2
Doesn't patch on latest build/
Comment by Tomer Shalev (tomers) - Sunday, 20 September 2009, 22:43 GMT+2
Synced to r22761.

Removed support for proprietary applications, as per Frank's suggestion.

Now supports three modes: Multimedia, Presentation and Browser.
Documentation relates to OpenOffice Impress and Firefox as example applications.
   usb_hid_show_keymap.diff (50.8 KiB)
 apps/screens.c                              |  293 ++++++++++++++++++++--------
 apps/action.h                               |   24 +-
 apps/lang/english.lang                      |   56 +++++
 apps/settings.h                             |    4 
 apps/menus/settings_menu.c                  |    6 
 apps/settings_list.c                        |    7 
 apps/keymaps/keymap-ondavx747.c             |   14 -
 apps/keymaps/keymap-c100.c                  |   17 +
 apps/keymaps/keymap-gigabeat-s.c            |   53 ++---
 apps/keymaps/keymap-c200.c                  |   24 +-
 apps/keymaps/keymap-e200.c                  |   28 +-
 apps/keymaps/keymap-sa9200.c                |   41 ++-
 apps/keymaps/keymap-touchscreen.c           |   23 +-
 apps/keymaps/keymap-clip.c                  |   28 +-
 apps/keymaps/keymap-h10.c                   |   39 ++-
 apps/keymaps/keymap-ipod.c                  |   42 ++--
 apps/keymaps/keymap-hdd1630.c               |   32 +--
 firmware/usbstack/usb_hid.c                 |   16 +
 manual/platform/e200.tex                    |    1 
 manual/configure_rockbox/system_options.tex |   25 ++
 20 files changed, 543 insertions(+), 230 deletions(-)

Comment by Tomer Shalev (tomers) - Monday, 21 September 2009, 08:07 GMT+2
Updated version:
* Save settings once, on USB disconnect, instead on each keypad mode change.
* Remove redundant gui statusbar drawing calls
   usb_hid_show_keymap.diff (50.5 KiB)
 apps/screens.c                              |  288 ++++++++++++++++++++--------
 apps/action.h                               |   24 +-
 apps/lang/english.lang                      |   56 +++++
 apps/settings.h                             |    4 
 apps/menus/settings_menu.c                  |    6 
 apps/settings_list.c                        |    7 
 apps/keymaps/keymap-ondavx747.c             |   14 -
 apps/keymaps/keymap-c100.c                  |   17 +
 apps/keymaps/keymap-gigabeat-s.c            |   53 ++---
 apps/keymaps/keymap-c200.c                  |   24 +-
 apps/keymaps/keymap-e200.c                  |   28 +-
 apps/keymaps/keymap-sa9200.c                |   41 ++-
 apps/keymaps/keymap-touchscreen.c           |   23 +-
 apps/keymaps/keymap-clip.c                  |   28 +-
 apps/keymaps/keymap-h10.c                   |   39 ++-
 apps/keymaps/keymap-ipod.c                  |   42 ++--
 apps/keymaps/keymap-hdd1630.c               |   32 +--
 firmware/usbstack/usb_hid.c                 |   16 +
 manual/platform/e200.tex                    |    1 
 manual/configure_rockbox/system_options.tex |   25 ++
 20 files changed, 543 insertions(+), 225 deletions(-)

Comment by Tomer Shalev (tomers) - Tuesday, 22 September 2009, 00:31 GMT+2
Added support for mouse movement mode! Now the DAP can be a mouse replacement :-)
   usb_hid_show_keymap.diff (67.9 KiB)
 apps/screens.c                              |  319 +++++++++++++++++++++-------
 apps/action.h                               |   24 +-
 apps/lang/english.lang                      |   70 ++++++
 apps/settings.h                             |    4 
 apps/menus/settings_menu.c                  |    6 
 apps/settings_list.c                        |    7 
 apps/keymaps/keymap-ondavx747.c             |   14 -
 apps/keymaps/keymap-c100.c                  |   17 -
 apps/keymaps/keymap-gigabeat-s.c            |   53 ++--
 apps/keymaps/keymap-c200.c                  |   24 +-
 apps/keymaps/keymap-e200.c                  |   28 +-
 apps/keymaps/keymap-sa9200.c                |   41 +--
 apps/keymaps/keymap-touchscreen.c           |   23 +-
 apps/keymaps/keymap-clip.c                  |   28 +-
 apps/keymaps/keymap-h10.c                   |   39 +--
 apps/keymaps/keymap-ipod.c                  |   42 ++-
 apps/keymaps/keymap-hdd1630.c               |   32 +-
 firmware/usbstack/usb_hid_usage_tables.h    |   14 +
 firmware/usbstack/usb_hid.c                 |  276 +++++++++++++++++-------
 manual/platform/e200.tex                    |    1 
 manual/configure_rockbox/system_options.tex |   27 ++
 21 files changed, 795 insertions(+), 294 deletions(-)

Comment by Tomer Shalev (tomers) - Tuesday, 22 September 2009, 15:30 GMT+2
Add Middle-Click support for mouse mode
   usb_hid_show_keymap.diff (67.4 KiB)
 apps/screens.c                              |  321 +++++++++++++++++++++-------
 apps/action.h                               |   24 +-
 apps/lang/english.lang                      |   70 ++++++
 apps/settings.h                             |    4 
 apps/menus/settings_menu.c                  |    6 
 apps/settings_list.c                        |    7 
 apps/keymaps/keymap-ondavx747.c             |   14 -
 apps/keymaps/keymap-c100.c                  |   17 -
 apps/keymaps/keymap-gigabeat-s.c            |   53 ++--
 apps/keymaps/keymap-c200.c                  |   24 +-
 apps/keymaps/keymap-e200.c                  |   28 +-
 apps/keymaps/keymap-sa9200.c                |   41 +--
 apps/keymaps/keymap-touchscreen.c           |   23 +-
 apps/keymaps/keymap-clip.c                  |   28 +-
 apps/keymaps/keymap-h10.c                   |   39 +--
 apps/keymaps/keymap-ipod.c                  |   42 ++-
 apps/keymaps/keymap-hdd1630.c               |   32 +-
 firmware/usbstack/usb_hid_usage_tables.h    |   15 +
 firmware/usbstack/usb_hid.c                 |  271 +++++++++++++++++------
 manual/platform/e200.tex                    |    1 
 manual/configure_rockbox/system_options.tex |   27 ++
 21 files changed, 795 insertions(+), 292 deletions(-)

Comment by Tomer Shalev (tomers) - Wednesday, 23 September 2009, 21:54 GMT+2
Changes since last patch:
-Extract the usb keymap mode logic into apps/usb_keymaps.[ch], thus make apps/screens.c neatier.

This patch tested extensively on e200. I guess this patch is stable and ready for testing. I would welcome any feedback, especially from users using other platforms.
I would appreciate if one of the committers (gevaerts?) will find the time to consider it for committing after we receive enough feedback.

Thanks,
Tomer
   usb_hid_show_keymap.diff (62.3 KiB)
 apps/screens.c                              |  176 ++++++++++--------
 apps/action.h                               |   24 +-
 apps/lang/english.lang                      |   70 +++++++
 apps/settings.h                             |    4 
 apps/menus/settings_menu.c                  |    6 
 apps/settings_list.c                        |    7 
 apps/SOURCES                                |    3 
 apps/keymaps/keymap-ondavx747.c             |   14 -
 apps/keymaps/keymap-c100.c                  |   17 +
 apps/keymaps/keymap-gigabeat-s.c            |   53 ++---
 apps/keymaps/keymap-c200.c                  |   24 +-
 apps/keymaps/keymap-e200.c                  |   28 +-
 apps/keymaps/keymap-sa9200.c                |   41 ++--
 apps/keymaps/keymap-touchscreen.c           |   23 +-
 apps/keymaps/keymap-clip.c                  |   28 +-
 apps/keymaps/keymap-h10.c                   |   39 ++--
 apps/keymaps/keymap-ipod.c                  |   42 ++--
 apps/keymaps/keymap-hdd1630.c               |   32 +--
 firmware/usbstack/usb_hid_usage_tables.h    |   15 +
 firmware/usbstack/usb_hid.c                 |  271 ++++++++++++++++++++--------
 manual/platform/e200.tex                    |    1 
 manual/configure_rockbox/system_options.tex |   27 ++
 22 files changed, 650 insertions(+), 295 deletions(-)

Comment by Frank Gevaerts (fg) - Wednesday, 23 September 2009, 22:08 GMT+2
I'll review this, but it will be next week at the earliest
Comment by Tomer Shalev (tomers) - Thursday, 24 September 2009, 08:51 GMT+2
Changes since last patch:
- Added mouse acceleration which mouse mode more usable.
   usb_hid_show_keymap.diff (65 KiB)
 apps/screens.c                              |  176 +++++++++-------
 apps/action.h                               |   33 ++-
 apps/lang/english.lang                      |   70 ++++++
 apps/settings.h                             |    4 
 apps/menus/settings_menu.c                  |    6 
 apps/settings_list.c                        |    7 
 apps/SOURCES                                |    3 
 apps/keymaps/keymap-ondavx747.c             |   14 -
 apps/keymaps/keymap-c100.c                  |   17 +
 apps/keymaps/keymap-gigabeat-s.c            |   53 ++---
 apps/keymaps/keymap-c200.c                  |   24 +-
 apps/keymaps/keymap-e200.c                  |   44 +++-
 apps/keymaps/keymap-sa9200.c                |   41 ++-
 apps/keymaps/keymap-touchscreen.c           |   23 +-
 apps/keymaps/keymap-clip.c                  |   28 +-
 apps/keymaps/keymap-h10.c                   |   39 ++-
 apps/keymaps/keymap-ipod.c                  |   42 ++-
 apps/keymaps/keymap-hdd1630.c               |   32 +--
 firmware/usbstack/usb_hid_usage_tables.h    |   17 +
 firmware/usbstack/usb_hid.c                 |  296 +++++++++++++++++++++-------
 manual/platform/e200.tex                    |    1 
 manual/configure_rockbox/system_options.tex |   27 ++
 22 files changed, 699 insertions(+), 298 deletions(-)

Comment by Tomer Shalev (tomers) - Saturday, 26 September 2009, 19:42 GMT+2
Changes since last patch:
- Support for iterating backwards over keypad modes using a long press.
- Removed support for middle mouse button
- Add support for left/right mouse dragging
- Fixed using define HAVE_USBSTACK instead of USB_ENABLE_HID
- Fixed some wrong HID buttons on various targets
- Add mouse keymaps for the following targets:
hdd1630; sa9200; ipod; gigabeat-s; clip; c100; c200; e200 (owners: please test and report)
   usb_hid_show_keymap.diff (101.9 KiB)
 apps/screens.c                              |  177 ++++++++------
 apps/action.h                               |   53 +++-
 apps/plugins/SOURCES                        |    2 
 apps/lang/english.lang                      |   70 +++++
 apps/settings.h                             |    6 
 apps/menus/settings_menu.c                  |    6 
 apps/settings_list.c                        |    7 
 apps/plugin.c                               |    4 
 apps/SOURCES                                |    3 
 apps/plugin.h                               |    4 
 apps/keymaps/keymap-ondavx747.c             |   16 -
 apps/keymaps/keymap-c100.c                  |   61 ++++
 apps/keymaps/keymap-gigabeat-s.c            |  106 ++++++--
 apps/keymaps/keymap-c200.c                  |   67 ++++-
 apps/keymaps/keymap-e200.c                  |   67 ++++-
 apps/keymaps/keymap-sa9200.c                |   80 ++++--
 apps/keymaps/keymap-touchscreen.c           |   27 +-
 apps/keymaps/keymap-clip.c                  |   67 ++++-
 apps/keymaps/keymap-h10.c                   |   45 ++-
 apps/keymaps/keymap-ipod.c                  |   75 ++++--
 apps/keymaps/keymap-mr100.c                 |    6 
 apps/keymaps/keymap-ondavx777.c             |    4 
 apps/keymaps/keymap-hdd1630.c               |   71 ++++-
 firmware/usbstack/usb_hid_usage_tables.h    |   34 ++
 firmware/usbstack/usb_core.c                |    2 
 firmware/usbstack/usb_hid.c                 |  343 +++++++++++++++++++++-------
 manual/platform/e200.tex                    |    1 
 manual/configure_rockbox/system_options.tex |   27 ++
 28 files changed, 1096 insertions(+), 335 deletions(-)

Comment by Tomer Shalev (tomers) - Sunday, 27 September 2009, 17:18 GMT+2
Changes since last patch:
- Added manual section with proper keymaps for all relevant platforms.

No further enhancements are expected.
   usb_hid_show_keymap.diff (128.9 KiB)
 apps/screens.c                              |  177 ++++++++------
 apps/action.h                               |   53 +++-
 apps/lang/english.lang                      |   70 +++++
 apps/plugins/SOURCES                        |    2 
 apps/settings.h                             |    6 
 apps/menus/settings_menu.c                  |    6 
 apps/settings_list.c                        |    7 
 apps/plugin.c                               |    4 
 apps/SOURCES                                |    3 
 apps/plugin.h                               |    4 
 apps/usb_keymaps.c                          |  240 +++++++++++++++++++
 apps/usb_keymaps.h                          |   28 ++
 apps/keymaps/keymap-ondavx747.c             |   16 -
 apps/keymaps/keymap-c100.c                  |   61 ++++
 apps/keymaps/keymap-gigabeat-s.c            |  107 ++++++--
 apps/keymaps/keymap-c200.c                  |   67 ++++-
 apps/keymaps/keymap-e200.c                  |   67 ++++-
 apps/keymaps/keymap-sa9200.c                |   80 ++++--
 apps/keymaps/keymap-touchscreen.c           |   27 +-
 apps/keymaps/keymap-clip.c                  |   67 ++++-
 apps/keymaps/keymap-h10.c                   |   47 ++-
 apps/keymaps/keymap-ipod.c                  |   75 ++++--
 apps/keymaps/keymap-mr100.c                 |    6 
 apps/keymaps/keymap-ondavx777.c             |    4 
 apps/keymaps/keymap-hdd1630.c               |   71 ++++-
 firmware/usbstack/usb_hid_usage_tables.h    |   34 ++
 firmware/usbstack/usb_core.c                |    2 
 firmware/usbstack/usb_hid.c                 |  343 +++++++++++++++++++++-------
 manual/platform/ipod3g.tex                  |    1 
 manual/platform/clip.tex                    |    1 
 manual/platform/h10.tex                     |    1 
 manual/platform/ipodmini.tex                |    1 
 manual/platform/keymap-gigabeats.tex        |    4 
 manual/platform/ipod1g2g.tex                |    1 
 manual/platform/ipodvideo.tex               |    1 
 manual/platform/h10_5gb.tex                 |    1 
 manual/platform/gigabeats.tex               |    1 
 manual/platform/ipod4g.tex                  |    1 
 manual/platform/ipodcolor.tex               |    1 
 manual/platform/c200.tex                    |    1 
 manual/platform/e200.tex                    |    1 
 manual/platform/ipodnano.tex                |    1 
 manual/configure_rockbox/system_options.tex |  263 +++++++++++++++++++++
 43 files changed, 1617 insertions(+), 337 deletions(-)

Comment by Tomer Shalev (tomers) - Sunday, 27 September 2009, 17:55 GMT+2
...oops, forgot this one:

- Use #define HAVE_USB_HID_MOUSE for target with sufficient number of keys to have a usable mouse emulation
   usb_hid_show_keymap.diff (133.9 KiB)
 apps/screens.c                              |  177 ++++++++------
 apps/action.h                               |   53 +++-
 apps/plugins/SOURCES                        |    2 
 apps/lang/english.lang                      |   70 +++++
 apps/settings.h                             |    6 
 apps/menus/settings_menu.c                  |    6 
 apps/settings_list.c                        |    7 
 apps/plugin.c                               |    4 
 apps/SOURCES                                |    3 
 apps/plugin.h                               |    4 
 apps/usb_keymaps.c                          |  248 +++++++++++++++++++
 apps/usb_keymaps.h                          |   28 ++
 apps/keymaps/keymap-ondavx747.c             |   16 -
 apps/keymaps/keymap-c100.c                  |   61 ++++
 apps/keymaps/keymap-gigabeat-s.c            |  107 ++++++--
 apps/keymaps/keymap-c200.c                  |   67 ++++-
 apps/keymaps/keymap-e200.c                  |   67 ++++-
 apps/keymaps/keymap-sa9200.c                |   80 ++++--
 apps/keymaps/keymap-touchscreen.c           |   27 +-
 apps/keymaps/keymap-clip.c                  |   67 ++++-
 apps/keymaps/keymap-h10.c                   |   47 ++-
 apps/keymaps/keymap-ipod.c                  |   75 ++++--
 apps/keymaps/keymap-mr100.c                 |    6 
 apps/keymaps/keymap-ondavx777.c             |    4 
 apps/keymaps/keymap-hdd1630.c               |   71 ++++-
 firmware/export/config-c200.h               |    1 
 firmware/export/config-e200.h               |    2 
 firmware/export/config-ipodvideo.h          |    1 
 firmware/export/config-ipodcolor.h          |    1 
 firmware/export/config-ipodmini.h           |    1 
 firmware/export/config-ipodmini2g.h         |    1 
 firmware/export/config-ipodnano.h           |    1 
 firmware/export/config-hdd1630.h            |    1 
 firmware/export/config-sa9200.h             |    1 
 firmware/export/config-ipod4g.h             |    1 
 firmware/export/config-gigabeat-s.h         |    1 
 firmware/usbstack/usb_hid_usage_tables.h    |   36 ++
 firmware/usbstack/usb_core.c                |    2 
 firmware/usbstack/usb_hid.c                 |  349 ++++++++++++++++++++++------
 manual/platform/ipod3g.tex                  |    1 
 manual/platform/clip.tex                    |    1 
 manual/platform/h10.tex                     |    1 
 manual/platform/ipodmini.tex                |    1 
 manual/platform/keymap-gigabeats.tex        |    4 
 manual/platform/ipod1g2g.tex                |    1 
 manual/platform/ipodvideo.tex               |    1 
 manual/platform/h10_5gb.tex                 |    1 
 manual/platform/ipod4g.tex                  |    1 
 manual/platform/gigabeats.tex               |    1 
 manual/platform/ipodcolor.tex               |    1 
 manual/platform/c200.tex                    |    1 
 manual/platform/e200.tex                    |    1 
 manual/platform/ipodnano.tex                |    1 
 manual/configure_rockbox/system_options.tex |  263 +++++++++++++++++++++
 54 files changed, 1644 insertions(+), 338 deletions(-)

Loading...