Support and General Use > Plugins/Viewers

Keyremap plugin - remaps keys in rockbox

<< < (2/4) > >>

Bilgus:
You don't need to define a whole keymap just a few actions that you want and if they aren't matched it falls through to the regular keymaps

keyremap contexts must match exactly -- re-mapped contexts run before the built in w/ fall through contexts
 ie. you can't remap CONTEXT_STD and expect it to match CONTEXT_WPS after if falls through to CONTEXT_STD
(keyremap only checks for matches in the (first) top level context)

The same caveats do apply as when you are doing a 'real' keymap though namely fallthrough contexts may eat your button before you get a match
--------------------------------------------------------------------------------------------
* Example: button = UP|REL, last_button = UP;
*  while looking in CONTEXT_WPS there is an action defined
*  {ACTION_FOO, BUTTON_UP|BUTTON_REL, BUTTON_NONE}
*  then ACTION_FOO in CONTEXT_WPS will be returned
*  EVEN THOUGH you are expecting a fully matched
*  ACTION_BAR from CONTEXT_STD
*  {ACTION_BAR, BUTTON_UP|BUTTON_REL, BUTTON_UP}
--------------------------------------------------------------------------------------------

PS. You can also block actions by using ACTION_NONE BTN PBTN

bahus:
Another cool feature! Thanks Bilgus!

I'm trying to block annoying pitch screen action on long press Play button in WPS on my Sansa Clip Zip (tested on build ee87bfb933)

So I'm adding CONTEXT_WPS re-maping entry, next adding 2 keys to Button column: BUTTON_MULTIMEDIA_PLAYPAUSE and BUTTON_REPEAT

So my re-maping looks like (Button looks a bit strange):
Context: WPS
Action: NONE
Button: HOME | BUTTON_REPEAT | BUTTON_MULTIMEDIA | BUTTON_MULTIMEDIA_PLAYPAUSE
PreBtn: NONE

Next I click Temp Core Remap and test my changes. Pitch screen still appears on long Play press in WPS :(

What am I doing wrong?
Button column representation looks suspicios to me. Why HOME and BUTTON_MULTIMEDIA  is there? I didn't add it...

Bilgus:
if you look at the list of buttons it the source https://github.com/Rockbox/rockbox/blob/master/firmware/export/button.h#L95

BUTTON_MULTIMEDIA_PLAYPAUSE is #define BUTTON_MULTIMEDIA_PLAYPAUSE (BUTTON_MULTIMEDIA|0x01)

it just returns the constituent buttons

BUT that won't work to block pitchscreen

instead try:
[WPS][ACTION_NONE][BUTTON_UP|BUTTON_REPEAT][BUTTON_NONE]

bahus:

--- Quote from: Bilgus on March 05, 2022, 07:56:58 AM ---instead try:
[WPS][ACTION_NONE][BUTTON_UP|BUTTON_REPEAT][BUTTON_NONE]

--- End quote ---

Works!! Thanks.

Some notes:
1) What about removing `BUTTON_` prefix in list of buttons and from cell? It seems already skipped in cell but only for first button. My remapping looks like: UP | BUTTON_REPEAT

2) Can list of keymaps in Load Keymaps be sorted by name? My current list looks like: [user_keyremap]1.kmf, 2.kmf, 6.kmf, 3.kmf, 4.kmf, 5.kmf.
Not sure why last keymap user_keyremap6.kmf in the middle of list...

3) Would be cool to support action that runs any particular plugin.

Bilgus:
Plugins I'd like to do but I think I need a button level redirect to do it because they can use custom keymaps that will be really hard to figure out
without combing through source..

the other stuff, no sorry its more code than its worth and greatly complicates the buffer situation

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version