function your_keyhandler(dialog, key)
-- Deal with the keys you want to catch
if key.name == 'foo' then
elseif key.name == 'bar' then
return key -- <-- this passes the key back to Renoise
If you want to make sure the key you caught doesn’t get sent back to Renoise, return
nil. You can do that inside of your conditional statements as needed.
As far as I know, the only key that needs special handling is the Escape key, since that appears to be hardwired into the dialog. With a dialog open, you can’t hit Escape to enter edit mode unless you explicitly deal with it in your keyhandler.
-- put this at the top of your keyhandler
if key.name == 'esc' then
renoise.song().transport.edit_mode = (renoise.song().transport.edit_mode == false) -- toggle edit mode
There’s a possibility the user has bound Escape to a different action, or unbound it for toggling edit mode, so this isn’t ideal, but it should work well for everybody else.