monome / norns

norns is many sound instruments.
http://monome.org
GNU General Public License v3.0
633 stars 147 forks source link

proposal: prevent global menu shortcut messing up w/ sub-menu's #1620

Closed p3r7 closed 1 year ago

p3r7 commented 1 year ago

before: if a sub-menu defines its own _menu.keycode callback, it gets evaluated in addition and after all the default global keycode mappings.

these default mappings are nice for most menus but can prevent making custom specialized interactions for sub-menus that have a slightly different logic (mod screens, typically).

after: if a sub-menu defines its own _menu.keycode, it takes precedence over all of the default menu mappings (except the F1..F4 shortcuts).

only small drawback: if this sub-menu wants to use some of the default mappings for itself, it needs to redefine them in its own _menu.keycode callback.

p3r7 commented 1 year ago

full disclosure of my use-case:

i have a fully working REPL for both maiden & sc as a mod.

i made the REPLs accessible through a norns mod sub-menu (instead of hijacking the script redraw function, too finicky) and you get to interact w/ it through the keyboard.

but the default keybindings for LEFT / RIGHT and UP / DOWN are messing up some of those it felt natural to define.

repl

tehn commented 1 year ago

onboard repl?? wow!!