1
0
Fork 0
forked from len0rd/rockbox
foxbox/apps/plugins
William Wilgus f7bb9e2167 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
2022-02-23 08:47:12 -05:00
..
beatbox [1/4] Remove SH support and all archos targets 2020-07-24 21:20:13 +00:00
bitmaps 2048 plugin: Fix disappearing numbers (FS#13303) 2021-11-09 10:30:28 -05:00
chessbox Document intentional fallthroughs + fix harmless unintended ones 2021-08-04 18:59:46 +00:00
clock Make fixepoint.c as a shared library (libfixedpoint.a). 2013-04-26 00:11:04 +02:00
doom Document intentional fallthroughs + fix harmless unintended ones 2021-08-04 18:59:46 +00:00
fft Convert FFT plugin to using PLA keymapings 2020-10-23 09:41:21 -04:00
fractals New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
frotz keyboard add ability to specify temporary custom layouts 2020-07-22 06:48:28 -04:00
goban Document intentional fallthroughs + fix harmless unintended ones 2021-08-04 18:59:46 +00:00
imageviewer ImageViewer: Fix FS#13329 (GIF File handle/memory leaks) 2022-01-09 14:36:14 +00:00
lib Add custom action mapping to core 2022-02-23 08:47:12 -05:00
lua Add custom action mapping to core 2022-02-23 08:47:12 -05:00
lua_scripts random_playlist.lua make index more sparse 2021-12-08 22:09:16 -05:00
midi New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
mikmod mikmod: Uninitialized variable used in a control flow decision 2021-08-05 13:44:33 +00:00
mpegplayer lib/helper add talk_val() 2021-08-18 21:30:13 -04:00
pacbox New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
pdbox Silence warnings that happen on newer GCCs 2020-10-13 20:09:14 -04:00
pictureflow PictureFlow: Fix broken (iPod) keymap 2022-01-30 16:36:07 -05:00
puzzles Use LIST_WRAP_UNLESS_HELD consistently 2021-12-05 14:17:52 -05:00
reversi New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
rockboy New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
sdl sdl: increase default worker thread size. 2021-06-28 02:51:48 +00:00
searchengine [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice. 2020-07-24 21:20:13 +00:00
shortcuts Add open_plugin to core 2020-08-17 10:15:14 -04:00
sudoku New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
text_viewer New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
xworld LCD core move buf ptr and address look up function viewport struct 2020-10-26 12:28:48 -04:00
zxbox New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
2048.c plugins: Fix issues in 2048 2021-08-04 19:04:37 +00:00
alarmclock.c Implement time-based resume and playback start. 2014-03-10 04:12:30 +01:00
announce_status.c announce_status Fix USB fall through and usb on plugin start 2021-11-13 03:38:28 -05:00
battery_bench.c battery_bench: Log battery current information 2021-12-23 11:39:58 +00:00
bench_mem_jpeg.c
bench_scaler.c
blackjack.c Remove the (very) incomplete port for the Tatung TPJ-1102 2021-08-14 16:29:39 -04:00
boomshine.lua lua boomshine update to use rockevents library 2020-06-25 13:50:57 +00:00
bounce.c Replace SAMSUNG_YH920_PAD with YH92X 2016-01-25 09:23:09 +01:00
brickmania.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
bubbles.c Document intentional fallthroughs + fix harmless unintended ones 2021-08-04 18:59:46 +00:00
BUILD_OVERLAY
calculator.c Document intentional fallthroughs + fix harmless unintended ones 2021-08-04 18:59:46 +00:00
calendar.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
CATEGORIES Add custom action mapping to core 2022-02-23 08:47:12 -05:00
chessbox.c
chessclock.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
chip8.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
chopper.c Nuke all TCC77x targets: iAudio 7, Sansa C100, M200(v1-3), Logik DAX 2021-04-26 07:41:51 -04:00
clix.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
codebuster.c do_menu pass internal synclist reference to callback 2020-07-19 22:10:26 +00:00
credits.c Credits plugin: use black background 2021-12-09 21:01:11 -05:00
credits.pl
crypt_firmware.c rockbox: move firmware checksum algorithms into a common header 2020-11-22 05:12:04 +00:00
cube.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
db_folder_select.c folder_select.c move to plugin as db_folder_select 2021-11-11 00:28:59 -05:00
demystify.c plugins: More HAVE_BACKLIGHT cleanup 2020-07-24 19:20:15 -04:00
dice.c FS#7704 - Talk support for plugins 2019-07-20 08:48:35 +02:00
dict.c keyboard add ability to specify temporary custom layouts 2020-07-22 06:48:28 -04:00
disktidy.c [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice. 2020-07-24 21:20:13 +00:00
disktidy.config
duke3d.c Port of Duke Nukem 3D 2017-12-23 21:01:26 -05:00
elfdep.pl
fire.c LCD core move buf ptr and address look up function viewport struct 2020-10-26 12:28:48 -04:00
fireworks.c plugins: More HAVE_BACKLIGHT cleanup 2020-07-24 19:20:15 -04:00
flipit.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
goban.c Fix yellows/reds. Red where caused by preprocessor condition mismatch. 2010-08-24 15:01:33 +00:00
greyscale.c Nuke the never-functional iriver ifp-7xx port 2021-04-26 07:42:58 -04:00
helloworld.c Update comments in the helloword plugin. 2010-08-30 20:58:38 +00:00
helloworld.lua Helloworld.lua: fix file_put_contents depending on a wrong return value of io.write + use a cleaner version of if(file == nil) (thanks to Christophe Gragnic) 2009-07-08 21:05:56 +00:00
invadrox.c Remove the (very) incomplete port for the Tatung TPJ-1102 2021-08-14 16:29:39 -04:00
iriver_flash.c rockbox: move firmware checksum algorithms into a common header 2020-11-22 05:12:04 +00:00
iriverify.c
jackpot.c [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice. 2020-07-24 21:20:13 +00:00
jewels.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
keybox.c Use LIST_WRAP_UNLESS_HELD consistently 2021-12-05 14:17:52 -05:00
keyremap.c Add custom action mapping to core 2022-02-23 08:47:12 -05:00
lamp.c Lamp plugin: Allow toggling the button light using "select". 2015-02-22 12:22:40 +01:00
logo.c [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice. 2020-07-24 21:20:13 +00:00
lrcplayer.c whitespace fixes 2021-10-21 22:42:01 +02:00
lua_scripts.lua lua print table put_line a do_menu alternative 2021-04-20 03:30:41 +00:00
main_menu_config.c whitespace fixes 2021-10-21 22:42:01 +02:00
matrix.c The Matrix plugin -- Bugfix 2021-04-16 10:10:15 -04:00
maze.c plugins: More HAVE_BACKLIGHT cleanup 2020-07-24 19:20:15 -04:00
mazezam.c plugins: More HAVE_BACKLIGHT cleanup 2020-07-24 19:20:15 -04:00
md5sum.c md5sum: clean up whitespace 2020-07-26 15:41:54 -04:00
metronome.c Document intentional fallthroughs + fix harmless unintended ones 2021-08-04 18:59:46 +00:00
minesweeper.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
mosaique.c [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice. 2020-07-24 21:20:13 +00:00
mp3_encoder.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
open_plugins.c Open_Plugin add checksum on struct offsets 2021-10-18 23:30:27 -04:00
oscilloscope.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
otp.c [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice. 2020-07-24 21:20:13 +00:00
pegbox.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
periodic_table.c Add tentative new element names, IUPAC approval expected around November 2016-12-04 18:05:51 +01:00
pictureflow.c
pitch_detector.c Revise the PCM callback system after adding multichannel audio. 2012-03-03 07:23:38 +01:00
pitch_screen.c pitchscreen make it a plugin 2021-11-10 22:38:37 -05:00
pixel-painter.lua Lua fix pixel-painter score save 2018-11-05 07:18:08 +01:00
plasma.c LCD core move buf ptr and address look up function viewport struct 2020-10-26 12:28:48 -04:00
plugin.lds DM320: Regorganize LCD and TTB memory layout 2021-07-09 09:24:38 +00:00
plugin_crt0.c
plugins.make rb_info plugin and button,action+context name helper 2021-11-22 21:39:45 -05:00
pong.c plugins pong, properties remove dead code 2021-07-22 23:24:12 +00:00
properties.c Use LIST_WRAP_UNLESS_HELD consistently 2021-12-05 14:17:52 -05:00
quake.c sdl: Fix path substitution in log messages, fix game names in comments 2019-08-22 22:00:43 +03:00
random_folder_advance_config.c whitespace fixes 2021-10-21 22:42:01 +02:00
rb_info.c gui lists add callback for owner drawn items 2022-01-01 23:56:51 -05:00
remote_control.c
resistor.c plugins/resistor: Fix incorrect check for a valid 4th band value 2021-08-04 14:56:20 +00:00
robotfindskitten.c robotfindskitten: clear message line before cinema scene 2019-07-28 01:30:29 +02:00
rockblox.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
rockblox1d.c
rockbox-fonts.config
rockboy.c Second try: Introduce plugin_crt0.c that every plugin links. 2010-08-24 14:30:46 +00:00
rocklife.c Document intentional fallthroughs + fix harmless unintended ones 2021-08-04 18:59:46 +00:00
rockpaint.c Document intentional fallthroughs + fix harmless unintended ones 2021-08-04 18:59:46 +00:00
search.c [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice. 2020-07-24 21:20:13 +00:00
settings_dumper.c EQ settings: Rework the settings to clean up the config file. 2013-02-09 13:05:32 +01:00
shopper.c Shopper: slightly improve plugin and manual 2015-09-24 23:15:24 +02:00
sliding_puzzle.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
snake.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
snake2.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
snake2.levels
snow.c [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice. 2020-07-24 21:20:13 +00:00
sokoban.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
sokoban.levels
solitaire.c Solitaire: Fix Quit option with no saved games 2022-01-01 22:01:30 -05:00
sort.c
SOURCES Add custom action mapping to core 2022-02-23 08:47:12 -05:00
SOURCES.app_build [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice. 2020-07-24 21:20:13 +00:00
spacerocks.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
speedread.c plugins: More HAVE_BACKLIGHT cleanup 2020-07-24 19:20:15 -04:00
star.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
starfield.c plugins: More HAVE_BACKLIGHT cleanup 2020-07-24 19:20:15 -04:00
stats.c plugins: More HAVE_BACKLIGHT cleanup 2020-07-24 19:20:15 -04:00
stopwatch.c Nuke the never-functional iriver ifp-7xx port 2021-04-26 07:42:58 -04:00
stopwatch.lua New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
SUBDIRS [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice. 2020-07-24 21:20:13 +00:00
SUBDIRS.app_build [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice. 2020-07-24 21:20:13 +00:00
superdom.c keyboard add ability to specify temporary custom layouts 2020-07-22 06:48:28 -04:00
test_boost.c Fix two variable-set-but-not-used warnings 2020-07-24 23:26:15 -04:00
test_codec.c plugins: HAVE_BACKLIGHT in the test plugins 2020-07-24 19:42:32 -04:00
test_core_jpeg.c
test_disk.c test_disk: Minor fix in an error path 2021-08-05 14:22:53 +00:00
test_fps.c plugins: HAVE_BACKLIGHT in the test plugins 2020-07-24 19:42:32 -04:00
test_gfx.c plugins: HAVE_BACKLIGHT in the test plugins 2020-07-24 19:42:32 -04:00
test_grey.c plugins: HAVE_BACKLIGHT in the test plugins 2020-07-24 19:42:32 -04:00
test_greylib_bitmap_scale.c test_X plugins PLA integration 2012-03-03 19:55:51 +01:00
test_mem.c test_mem: fix asm variant of read/write test 2020-11-04 13:00:01 +00:00
test_mem_jpeg.c
test_resize.c LCD core move buf ptr and address look up function viewport struct 2020-10-26 12:28:48 -04:00
test_sampr.c Add 192 and 176KHz to mikmod and test_sampr plugins 2020-09-30 22:52:56 -04:00
test_scanrate.c [1/4] Remove SH support and all archos targets 2020-07-24 21:20:13 +00:00
test_touchscreen.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
test_viewports.c code cleanup encase ;; in brackets {;;} 2021-08-13 11:51:21 +00:00
test_viewports.lua
text_editor.c keyboard add ability to specify temporary custom layouts 2020-07-22 06:48:28 -04:00
theme_remove.c [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice. 2020-07-24 21:20:13 +00:00
vbrfix.c plugins trade talk_value for talk_value_decimal 2021-08-19 01:17:29 +00:00
viewers.config Database: show song's album in PictureFlow 2021-12-28 11:06:10 -05:00
vu_meter.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
wav2wv.c [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice. 2020-07-24 21:20:13 +00:00
wavview.c plugins: make local functions static for metronome, rockblox1d, wavview 2011-10-04 19:33:52 +00:00
windows_lnk.c plugin windows_lnk: fix missing return-on-error 2020-07-07 02:36:33 +00:00
wolf3d.c sdl: Fix path substitution in log messages, fix game names in comments 2019-08-22 22:00:43 +03:00
wormlet.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
xobox.c New port: Shanling Q1 native 2021-07-13 22:01:33 +01:00
zxbox.c