android
  #1  
Old 09-04-2010, 09:09 AM
Confuseling Confuseling is offline
Member
 
Join Date: May 2010
Posts: 227
Default Alternative keybindings attempt thread!

[Edit - This is a second attempt, which appears to play much better...]

I decided to embark on this mission, though it's proved harder than I thought - for example, you can't just switch on the keylock on the radio, some deeper digging must be necessary.

However, with a bit of rearrangement, I've added the hotkeys (short home), and what effectively amounts to an [almost] always functional 'start / stop' key you can use without having to look (long home). To do this, I've had to move the quickscreen to short down (you crazy kids who want to turn your backlight back on will just have to use short power...), but otherwise I think I've just squeezed out a bit of redundancy in ways to move around the menu. It's not a *great* deal of added functionality, sure, but I think I prefer it, and it's been interesting to play around with anyway.

To use, first you need to uncomment the last line of /firmware/export/config/sansaclipplus.h to turn on the hotkeys.

Then apply this diff to /apps/keymaps/keymap-clip.c

Code:
Index: keymap-clip.c
===================================================================
--- keymap-clip.c	(revision 27995)
+++ keymap-clip.c	(working copy)
@@ -39,9 +39,6 @@
     { ACTION_STD_NEXT,        BUTTON_DOWN,                      BUTTON_NONE },
     { ACTION_STD_NEXTREPEAT,  BUTTON_DOWN|BUTTON_REPEAT,        BUTTON_NONE },
 
-    { ACTION_STD_MENU,        BUTTON_HOME|BUTTON_REL,           BUTTON_HOME },
-    { ACTION_STD_QUICKSCREEN, BUTTON_HOME|BUTTON_REPEAT,        BUTTON_HOME },
-
     { ACTION_STD_OK,          BUTTON_SELECT|BUTTON_REL,         BUTTON_SELECT },
     { ACTION_STD_OK,          BUTTON_RIGHT,                     BUTTON_NONE },
     { ACTION_STD_CANCEL,      BUTTON_LEFT,                      BUTTON_NONE },
@@ -55,7 +52,7 @@
 
 static const struct button_mapping button_context_wps[]  = {
     { ACTION_WPS_PLAY,     BUTTON_UP|BUTTON_REL,        BUTTON_UP },
-    { ACTION_WPS_STOP,     BUTTON_POWER|BUTTON_REL,     BUTTON_POWER },
+    { ACTION_WPS_STOP,     BUTTON_HOME|BUTTON_REPEAT,     BUTTON_NONE },
 
     { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL,    BUTTON_LEFT },
     { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
@@ -77,18 +74,17 @@
     { ACTION_WPS_BROWSE,        BUTTON_SELECT|BUTTON_REL,     BUTTON_SELECT },
     { ACTION_WPS_CONTEXT,       BUTTON_SELECT|BUTTON_REPEAT,  BUTTON_SELECT },
 
-    { ACTION_WPS_QUICKSCREEN,   BUTTON_HOME|BUTTON_REPEAT,    BUTTON_HOME },
-    { ACTION_WPS_MENU,          BUTTON_HOME|BUTTON_REL,      BUTTON_HOME },
+    { ACTION_WPS_QUICKSCREEN,   BUTTON_DOWN|BUTTON_REL,      BUTTON_NONE },
 
     { ACTION_WPS_PITCHSCREEN,   BUTTON_UP|BUTTON_REPEAT,        BUTTON_NONE },
     { ACTION_WPS_ID3SCREEN,     BUTTON_SELECT|BUTTON_DOWN,      BUTTON_SELECT },
 
 #ifdef HAVE_HOTKEY /* down|repeat doesn't work in the file browser */
-    { ACTION_WPS_HOTKEY,        BUTTON_DOWN|BUTTON_REPEAT,      BUTTON_NONE }, 
-#else
-    { ACTION_WPS_VIEW_PLAYLIST, BUTTON_DOWN|BUTTON_REPEAT,      BUTTON_NONE }, 
+    { ACTION_WPS_HOTKEY,        BUTTON_HOME|BUTTON_REL,         BUTTON_HOME }, 
 #endif
 
+    { ACTION_WPS_VIEW_PLAYLIST, BUTTON_DOWN|BUTTON_REPEAT,      BUTTON_NONE }, 
+
 #ifndef HAS_BUTTON_HOLD /* Clip+ */
     { ACTION_STD_KEYLOCK,       BUTTON_HOME|BUTTON_SELECT,      BUTTON_NONE },
 #endif /* HAS_BUTTON_HOLD */
@@ -134,10 +130,10 @@
 }; /* button_context_list */
 
 static const struct button_mapping button_context_tree[]  = {
-    { ACTION_TREE_WPS,    BUTTON_HOME|BUTTON_SELECT,    BUTTON_HOME },
+    { ACTION_TREE_WPS,    BUTTON_HOME|BUTTON_REPEAT,    BUTTON_NONE },
     { ACTION_TREE_STOP,   BUTTON_POWER|BUTTON_REL,      BUTTON_POWER },
 #ifdef HAVE_HOTKEY
-//    { ACTION_TREE_HOTKEY, BUTTON_NONE,                  BUTTON_NONE },
+    { ACTION_TREE_HOTKEY, BUTTON_HOME|BUTTON_REL,       BUTTON_NONE },
 #endif
 
     LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
If anyone is interested in trying this, let me know if you find anything that's missing or broken. Any bright ideas for improvements are most welcome too...

[removed old versions]

ETA fifty-third-time-lucky: I reckon the posted patch might actually now work!

Last edited by Confuseling; 09-05-2010 at 04:51 PM.
Reply With Quote

Advertisement [Remove Advertisement]

  #2  
Old 09-05-2010, 12:00 AM
Confuseling Confuseling is offline
Member
 
Join Date: May 2010
Posts: 227
Default

New version, now pretty much the entire keymap rewritten. Hopefully it's a bit more consistent (with a few notable exceptions - not sure what's going on with the recording screen, for example... It doesn't seem to do as it's told [user error edit - recording screen now fixed])

The patch should now alter both files (hopefully...). The zips are self-contained anyway.

http://dl.dropbox.com/u/1257491/rock...ate.keymap.zip [power for menu]

http://dl.dropbox.com/u/1257491/rock...e.keymap.2.zip [home for menu]

[Have removed the diff - check the flyspray link below]

Last edited by Confuseling; 09-06-2010 at 06:13 AM.
Reply With Quote

  #3  
Old 09-05-2010, 11:41 AM
funman funman is offline
Rockbox Developer
 
Join Date: Jul 2008
Posts: 161
Default

Thanks for working on this,

What about bringing this work on rockbox bug/patch tracker (flyspray) ?
Reply With Quote

  #4  
Old 09-05-2010, 12:15 PM
Confuseling Confuseling is offline
Member
 
Join Date: May 2010
Posts: 227
Default

Quote:
Originally Posted by funman View Post
Thanks for working on this,

What about bringing this work on rockbox bug/patch tracker (flyspray) ?
No problems! (Thanks for Rockbox, might be a better way to put it! )

Wasn't sure if this was going to work out, so didn't put it on flyspray initially. I've refined it a little more, so it's there now - personally I consider it usable.

http://www.rockbox.org/tracker/task/11605
Reply With Quote

  #5  
Old 09-07-2010, 04:53 PM
Confuseling Confuseling is offline
Member
 
Join Date: May 2010
Posts: 227
Default

So, this is pretty much ready, the links to the zips above should be the latest version. Anyone up for testing? Version two is slightly 'out there', having some nice functionality, but seeming to have painted itself into a corner consistency wise. Version one, however, to my mind adds functionality and loses nothing. I'd like to propose it for inclusion, but obviously it needs to run the comments gauntlet first...

It's basically the same as it is now, with the addition of the hotkey (short home in WPS, home and select in filebrowser), and a stop/start key (long home). Other than that, hopefully it feels a little more consistent - keep pressing (short power) to get back to the menu, and you can't go wrong. But I can't tell any more, because I've been staring at it for too long...
Reply With Quote

  #6  
Old 09-08-2010, 02:51 AM
pechinma pechinma is offline
Junior Member
 
Join Date: Mar 2010
Posts: 31
Default

works great for me. very handy to be able to start/stop with one hand and without looking at the screen. thumbs up.
Reply With Quote

  #7  
Old 09-08-2010, 11:39 AM
Confuseling Confuseling is offline
Member
 
Join Date: May 2010
Posts: 227
Default

Thanks for the feedback. You were using version 2 before, weren't you. I quite like version 2, but it is inconsistent - too inconsistent, I feel, to propose for inclusion. Any chance you could give version 1 a spin for a day or two, and report any problems / suggestions? My only real bugbear is that from the WPS, pressing [select] for browse then [home] will take you to the menu, rather than back to the WPS... Doesn't seem to be a lot I can do about it though...

The code is beyond my understanding, but it seems to be quite an elaborate system whereby certain 'contexts' partially override others. In many ways it would be simpler (if more laborious) if you could specify by hand what each button did in each screen (preferably with hysteresis too...), but I imagine this might well make the code unnecessarily large and complex.

Still, my hat goes off to people who have developed the keymaps. It's a lot blinking harder than it looks at first!

Last edited by Confuseling; 09-08-2010 at 11:55 AM.
Reply With Quote

  #8  
Old 09-13-2010, 04:27 PM
pechinma pechinma is offline
Junior Member
 
Join Date: Mar 2010
Posts: 31
Default

i tried ver1 and didn't like it as much as ver2. it's more logical that the same button that pauses also un-pauses, so to speak.

ver2 has been very useful so far, at the gym and in other situations. one thing though, that i find a bit annoying is that sometimes you have to press long home twice. i think it's because it's not in WPS by the first click and thats when this happens. not a biggie though
Reply With Quote

  #9  
Old 09-19-2010, 09:26 AM
Confuseling Confuseling is offline
Member
 
Join Date: May 2010
Posts: 227
Default

Cheers for testing, and sorry it's taken me a while to have a chance to respond.

In version 1 you can start / stop with [long home], it's just that getting into the menu without stopping is done with [short power].

I agree, the core controls of version 2 are nicer, but unfortunately the way it's set up seems to prevent me making some of the darker corners consistent in version 2. Basically, there's no prospect of separating 'exit to WPS' on [short home] from what [short home] does in lots of other places, so adding that 'breaks' them.

It is unfortunate that it can take up to 3 presses of [long home] to stop play, depending on where you are (and indeed that in some places, it doesn't do anything). I'll see if I can make that better, but it doesn't look particularly hopeful...

Last edited by Confuseling; 09-19-2010 at 09:53 AM.
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 11:59 PM.