I'm trying to add context menus into a (large) custom control in my application but have run into a number of issues with when to create them.
There are 3 cases when a context menu needs to be created (unless I forgot one...) on a right mouse click, when the menu key is pressed and for Shift + F10. In all cases the menu is created and displayed by a ContextMenu method.
The right mouse does some other special stuff and so shouldn't always create a context menu. I'm handling the various mouse events and call ContextMenu as needed, which is all working nicely.
The problem is with the keyboard generated context menus. I've set a handler in my control for EVT_CONTEXT_MENU which then just calls ContextMenu. In a lot of cases both key combinations appear to just be ignored. Sometimes the Shift+F10 works correctly, but in the same cases the menu key is somehow invoking my right mouse click handlers, resulting in incorrect behaviour...
For the menu key I also tried handling the key events, but the menu key never seems to trigger these in wxWidgets although all the other keys seem to work fine...
Why are the key methods somehow ignored by wxWidgets. They should work as long as the control has focus. When they start "working" they keep working until it looses focus again, but im not sure why they don't to start with or what is causing them to start working (I don't handle any context menu or key events anywhere else in my test app).
How is the menu key event getting into my EVT_RIGHT_UP handler instead of the key events or context menu events?
I assume it is something fundamentally wrong with my understanding of how wxWidgets handles these keys, however having looked around the documentation and on the net for some time I haven't found any info regarding my issues.
I am using wxMSW 2.8.10 on Windows Vista.