Re: Handling wxKeyEvent in another wxStyledTextCtrl
Eran Ifrah <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.general |
|---|---|
| Message-ID | <[email protected]> |
So, If I was to use `wxTextCtrl` as the receiving control, it should work? (i.e. can I move the event by simply calling ProcessEvent()?) On Friday, July 28, 2023 at 12:56:23 AM UTC+3 Vadim Zeitlin wrote: > On Thu, 27 Jul 2023 12:36:12 -0700 (PDT) Eran Ifrah wrote: > > EI> I have a small question: > EI> I have a custom control which consists of 2 wxStyledTextCtrl (laid out > EI> vertically) > EI> > EI> My end goal: when a user types a character inside the top > wxStyledTextCtrl, > EI> I want it to be processed by the bottom wxStyledTextCtrl. > > There is unfortunately no way to make it work reliably on all platforms > right now. It would be nice to have one. > > EI> Can this be achieved? > EI> (I tried various solutions, none seemed to work. For example: bind > EI> wxEVT_CHAR_HOOK and in the top wxSTC and then setting the focus to the > EI> bottom followed by calling `ProcessEvent` in the lower wxSTC > > This can't work because wxSTC, not being fundamentally implemented in wx, > has no idea about what to do with wx events. The events need to be > forwarded at lower level. wxUIActionSimulator does work at lower level, but > it doesn't really forward anything but synthesizes new events, which is not > 100% reliable. And, of course, wxUIActionSimulator doesn't work at all in > wxGTK when using Wayland currently (and has problems under Mac too). > > Doing this correctly would require some platform-specific code. Under MSW > it should be simple enough to just forward all WM_KEYXXX events, but I'm > less sure about the other platforms. > > Regards, > VZ > > -- > TT-Solutions: wxWidgets consultancy and technical support > https://www.tt-solutions.com/ > -- Please read https://www.wxwidgets.org/support/mlhowto.htm before posting. --- You received this message because you are subscribed to the Google Groups "wx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/e7dc83ff-46eb-427a-b986-e494f7954c5fn%40googlegroups.com.