You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to add an interactive text box to my plugin using the TextEdit widget.
The TextBuffer::insert_text method of my text buffer never gets called and if i use ui.input(...) to check for a specific key-press it also never gets called.
It seems like egui does not receive keyboard input at all.
Do i need to do any extra preparations to enable keyboard input to the GUI? I can't find any documentation on this.
This is the code of interest inside an egui panel:
let mut buf = params.tuning_text_buffer.load();
let response = ui.add(
nih_plug_egui::egui::widgets::TextEdit::singleline(&mut buf)
.char_limit(TUNING_NAME_LENGTH_MAX)
.interactive(true)
);
if response.changed()
{
// Never changed
params.tuning_text_buffer.store(buf);
}
if response.has_focus()
{
ui.input(|i| if i.key_down(egui::Key::Backspace)
{
// Never gets called
response.surrender_focus()
});
let mut clicked = false;
ui.toggle_value(&mut clicked, "12edo");
}
params.tuning_text_buffer is a struct inside an Arc<AtomicCell<...>> that implements egui::TextBuffer
The text was updated successfully, but these errors were encountered:
I'm trying to add an interactive text box to my plugin using the TextEdit widget.
The
TextBuffer::insert_text
method of my text buffer never gets called and if i useui.input(...)
to check for a specific key-press it also never gets called.It seems like egui does not receive keyboard input at all.
Do i need to do any extra preparations to enable keyboard input to the GUI? I can't find any documentation on this.
This is the code of interest inside an egui panel:
params.tuning_text_buffer
is a struct inside anArc<AtomicCell<...>>
that implementsegui::TextBuffer
The text was updated successfully, but these errors were encountered: