Re: Re[4]: Mac shortcut keys issue. Keys being sent to parent frame window.
Tony Kennedy <[email protected]> Tue, 1 Apr 2025 12:37:20 -0700 (PDT)
| Newsgroups | gmane.comp.lib.wxwindows.general |
|---|---|
| Message-ID | <[email protected]> |
I'm no Mac specialist either. This has been driven by our users, they are complaining that in a floating panel containing a text control, the shortcut keys are not working. And they are right, the wxTextCtrl handles copy/paste etc, but if the wxTextCtrl is in a floating window, the main window intercepts the key presses. If the floating window had it's own menu, then sending the shortcut key to the menu would make sense. Maybe things need to be a little more complex. There are two possibilities. Either the current functionality in wx is wrong, or my app doesn't implement copy/paste correctly. Copy/paste in my app target the main window, not the control with the focus. So maybe the correct thing to do is modify the copy/paste code so it works on the control with the focus. But that probably would not work for me as a user can select things, then change config in another window before hitting copy/paste. Maybe the correct thing to do (for my app) is disable the main window copy/paste when a wxTextCtrl has focus. I'll experiment with that tomorrow to see if it fixes things (implementing that could take a ton of work though). Tony. PS. I've had some feedback from my first user : I think the shortcuts for the comment section are entirely fixed. I could do cmd+c, cmd+v, option+delete, command+delete inside the comment section without any problems. Also, the shortcuts work perfectly everywhere (not just the comment section). On Tuesday, 1 April 2025 at 17:52:21 UTC+1 Vadim Zeitlin wrote: > On Tue, 1 Apr 2025 06:42:34 -0700 (PDT) Tony Kennedy wrote: > > TK> In the existing wxWidgetCocoaImpl::keyEvent function (window.mm), > when a > TK> key event happens, it's sent to the menu first. If I re-order the > function > TK> to what is below (let the control have a go first), copy/paste work. > TK> > TK> Are there any Mac specialists here that can comment on this change? > > I'm not a Mac specialist, but I think that Mac applications are supposed > to send the events to the menu first, so it probably wouldn't be a good > idea to change this for the normal case. Can this be only done if the > current window is a floating one? > > Thanks, > 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 visit https://groups.google.com/d/msgid/wx-users/2545406b-975d-424a-a74c-db31c0d45605n%40googlegroups.com.