Support and General Use > Plugins/Viewers

Keyremap plugin - remaps keys in rockbox

(1/5) > >>

Bilgus:
keyremap

I finally have a plugin written to allow users to change keymaps without recompiling
a build.

a lot of support code needed to be written to get to this point

builds after today (02-23-2022) have the keyremp plugin
https://gerrit.rockbox.org/r/c/rockbox/+/3274

in the first image you can see the edit interface

Add Context allows adding a new context
selecting a context adds a new action (2nd image)
empty contexts and actions with button&prebutton == NONE will not be saved to the remap

Update: Keymaps can now be exported and imported with plain text

Update(1/2/2023): devices with softlock (no physical hold switch) now have the option of _LOCKED contexts
you can choose a different keymapping when the device is locked
_REMOTE contexts are also now supported

Bilgus:
Ive updated the plugin with a way to apply the keyremap temporarily, and a way to remove the remap (renames it to core_deleted.kmf.old)

A couple example remaps

WPS Long press Volume_Down to stop playback

First Select 'Add Context'
Choose 'CONTEXT_WPS'
Select item 'CONTEXT_WPS' to add a new action

you should now see
[Add Context]
[CONTEXT_WPS]
[WPS][NONE][NONE][NONE}
(if you add too many actions don't worry if button is set to NONE it will be ignored when saving and applying)

using the select button move to each field (long press selects the field)

The button and prebutton fields will automatically 'mathematically (bitwise) OR |' each button you select
(choose BUTTON_NONE to reset)

when you are fininshed your screen should look like this..
[Add Context]
[CONTEXT_WPS]
[WPS][ACTION_WPS_STOP][VOL_DOWN|BUTTON_REPEAT][NONE]

next choose Temp Core Remap and quit the plugin
(save if you desire or hit select at the prompt on exit to save)
Now go to the WPS play a song and a long press of volume down should stop playback

--------------------------------------------------------------------------------------------------------------
MAINMENU Long press Volume_Down to stop playback

First Select 'Add Context'
Choose 'CONTEXT_MAINMENU'
Select item 'CONTEXT_MAINMENU' to add a new action

you should now see
[Add Context]
[CONTEXT_MAINMENU]
[MAINMENU][NONE][NONE][NONE}
(if you add too many actions don't worry if button is set to NONE it will be ignored when saving and applying)

using the select button move to each field (long press selects the field)

The button and prebutton fields will automatically 'mathematically (bitwise) OR |' each button you select
(choose BUTTON_NONE to reset)

when you are fininshed your screen should look like this..
[Add Context]
[CONTEXT_MAINMENU]
[MAINMENU][ACTION_TREE_STOP][VOL_DOWN|BUTTON_REPEAT][NONE]

next choose Temp Core Remap and quit the plugin
(save if you desire or hit select at the prompt on exit to save)
Now go to the WPS play a song then return to main menu and a long press of volume down should stop playback

Notice how we didn't use ACTION_WPS_STOP here that isn't a valid action to the mainmenu and it will not work
(I had to look in the source to figure that one out)

STEELBAS:
Nice work, I'll be sure to try this out.

Bilgus:
Now in the latest dev builds

dconrad:
That's awesome!

So do you need to define an entire keymap in the plugin, or can you just define one or two new actions which will take priority over the stock keymap, but otherwise use the stock keymap?

Navigation

[0] Message Index

[#] Next page

Go to full version