mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Add custom action mapping to core
results of an idea I discussed in IRC changed the way the lookup in the remap file works.. entries consist of 3 int [action, button, prebtn] context look up table is at the beginning action_code contains the (context | CONTEXT_REMAPPED) button_code contains the index of the first remapped action for the matched context [0] CORE_CONTEXT_REMAP(ctx1) offset1=(3), count=(1) [1] CORE_CONTEXT_REMAP(ctx2, offset2=(5), count=(1) [2] sentinel, 0, 0 [3] act0, btn, 0 [4] sentinel 0, 0 [5] act1, btn, 0 [6] sentinel, 0, 0 Note: last entry of each group is always the sentinel [CONTEXT_STOPSEARCHING, BUTTON_NONE, BUTTON_NONE] contexts must match exactly -- re-mapped contexts run before the built in w/ fall through contexts ie. you can't remap std_context and expect it to match std_context actions from the WPS context. -- Done -- Code for reading core remap entries -- Done -- import of core remap entires from disk -- Done -- plugin to set new key mapping (the hard part) The plugin is started and FULLY functional you can add actions and contexts you can change context, action, button, prebtn delete keymap files load keymapfiles save user keymaps test keymaps before applying them loading keymaps to core still requires restart ----------------------------------------------------------------------------------------------- Change-Id: Ib8b88c5ae91af4d540e1829de5db32669cd68203
This commit is contained in:
parent
7952687185
commit
f7bb9e2167
14 changed files with 1928 additions and 3 deletions
|
@ -32,7 +32,9 @@ struct available_button
|
|||
* generated at compile time you can still call it as such though
|
||||
* eg available_buttons[0] or available_buttons[available_button_count] (NULL SENTINEL, 0)*/
|
||||
|
||||
extern const size_t button_helper_maxbuffer;
|
||||
extern const struct available_button * const available_buttons;
|
||||
extern const int available_button_count;
|
||||
|
||||
int get_button_names(char *buf, size_t bufsz, unsigned long button);
|
||||
#endif /* _BUTTON_HELPER_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue