Re: wxGTK with GTK3: Menu shortcuts don't work when some (most?) controls are focused
Vadim Zeitlin <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.general |
|---|---|
| Message-ID | <[email protected]> |
On Sun, 7 May 2023 02:32:18 +0100 Carlos Azevedo wrote:
CA> My app has a wxAUI frame with several panes and one of them contains a
CA> wxTreeCtrl. The frame has a menu bar with a menu item with a Ctrl+N
CA> shortcut, that only works before clicking on the wxTreeCtrl.
CA> I've found that the issue is driven by the currently focused control; if
CA> the control recognizes Ctrl+N as a valid key for some action it will
CA> consume the key press and prevent the menu shortcut from triggering. The
CA> same code on wxMSW works without issues.
But this is just because wxTextCtrl doesn't handle Ctrl+N specially under
MSW, right? I.e. the same issue would happen there if you used Ctrl+C or
Ctrl+V that wxTextCtrl does handle on its own.
CA> This is a common problem from what I gather from this issue and others
CA> found in here and online.
This is true, but unfortunately the reverse problem is (or was, before the
behaviour was changed to the current one) even more common. I.e. people
complained about the standard shortcuts not working in wxTextCtrl just
because they used them as accelerators in some menu.
CA> P.S. I've also posted this query as a comment to issue 22625
There is #22630 linked from the issue you've commented on (BTW, I took the
liberty of editing your comment to fix the markup around the code in it).
I've noted some ideas about how this issue could be solved there, but I
didn't have time to really think it all through, let alone implement it.
But at least the goals are clear, IMO: we need to
1. Ensure that the behaviour is the same under all platforms by default.
2. Make it possible to override this default behaviour if necessary.
Any proposals about how exactly this should be done would be very welcome!
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
signature.asc
(application/pgp-signature, 196 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iEYEABECAAYFAmRX9E4ACgkQBupB3k9sHobD3gCdEJ5opsM2L7VCYrwTpWU63QxV LkAAoKrl3XFOuC1LWvmMLn2H7zDEGoBl =B4TS -----END PGP SIGNATURE-----