A simple question with a simple answer which is, I think, “no”. But here goes:
I have a multiline_textfield view as part of a dialog that has a key_handler function defined.
What happens: if focus is on the multiline_textfield and I hit everything behaves as if I had not held down the key.
What I want: to detect the key as pressed. For example: have the multiline_textfield not consume the but have it end up in the key_handler function for the dialog.
Is there a way to detect a key as pressed when focus is on a multiline_textfield?
I played around for an hour and couldn’t figure out a way to do it. Here’s what I ended up with.
local vb = renoise.ViewBuilder()
function self_aware(value)
-- rprint(value)
-- rprint(vb.views.test.paragraphs)
rprint(string.find(value, "%c"))
end
local content_view = vb:row {
vb:multiline_textfield {
id = "test",
width = 100,
height = 100,
notifier = self_aware
}
}
function key_handler(dialog, key)
rprint(key)
end
renoise.app():show_custom_dialog('Test', content_view, key_handler)
In the “self_aware” function I was able to detect the index of a “control character” using string.find() and %c, but I’m not sure how useful this is… Obviously a hack.