Checking if something is a hotkey before processing it as char

8 views
Skip to first unread message

gunter.ko...@gmail.com

unread,
Sep 12, 2021, 8:48:37 PM9/12/21
to wx-users
Dear all,

Which keys are hotkeys depends on the translation strings which sometimes makes it hard for me to decide if this was a hotkey (and therefore should be run through Skip() in the KeyDown event) or should be interpreted by my application as a [at least potential] letter.

Just assuming that everything containing a Ctrl or Alt key won't be a real letter doesn't really work.

My latest iteration on the problem seems now have caused Ctrl+M to be interpreted as an Enter key, not as a hotkey - which both is technically correct => Could anybody give me a hint in which way I am holding it wrong?

Thanks in advance,

        Gunter.

Vadim Zeitlin

unread,
Sep 13, 2021, 6:25:20 AM9/13/21
to wx-u...@googlegroups.com
On Sun, 12 Sep 2021 17:48:37 -0700 (PDT) gunter.ko...@gmail.com wrote:

g> Which keys are hotkeys depends on the translation strings which sometimes
g> makes it hard for me to decide if this was a hotkey (and therefore should
g> be run through Skip() in the KeyDown event)

Why do you want to do this in the first place? Accelerators don't even get
sent to wxEVT_KEY_DOWN handler, they're processed earlier, so there
shouldn't be any need to skip them.

I'm only aware of the inverse problem, i.e. when you do want to handle
some accelerators (e.g. Ctrl-C is a common candidate) in some control. But
if you want accelerators to work as accelerators, you don't have anything
special to do.

Which problem exactly are you trying to solve?
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Reply all
Reply to author
Forward
0 new messages