I have a wxTextControl and a wxButton on a wxFrame, and I want Shift+Enter to cause the button to be clicked. The wxAcceleratorTable documentation says that this is possible:
"For example, you can use an accelerator table to enable a dialog with a multi-line text control to accept CTRL-Enter as meaning 'OK'."
I can't get it to work. Can you give me a short example of how to use wxFrame, wxTextControl, wxButton, and wxAcceleratorTable together?
It turns out that wxAcceleratorTable can only be used with wxEVT_MENU on wxGTK. So the code would have looked like this:
wxAcceleratorEntry shiftReturn(wxACCEL_SHIFT, WXK_RETURN, wxID_BACKWARD);
SetAcceleratorTable(wxAcceleratorTable(1, &shiftReturn));
Bind(wxEVT_MENU, &FindFrame::OnPrev, this, wxID_BACKWARD);
Instead, we decided to use native accelerators for GTK and OSX instead of wx accelerators, so that the keyboard shortcut would animate the target button. See 604cdb5, b00a76e, and 91a8d2a at Poedit's GitHub page.