Virtual key mapping
Marcin 'Malcom' Malich
malcompl at gmail.com
Tue May 6 15:39:04 PDT 2008
On 6 Maj, 19:32, Vadim Zeitlin <va... at wxwidgets.org> wrote:
> We could also generate a key event for it if mouse event is not processed
> but it looked like a good idea at the time when this key was introduced
> under Windows to provide automatic support for it in the existing code
> which only handled right mouse clicks. Of course, using the same logic we
> should generate wxContextMenuEvent for it [too?] and not wxMouseEvent...
I added handle to wxEVT_CONTEXT_MENU in app.
mouse button right up:
- OnMouseRightUp
- OnContextMenu with cursor position (called only if event.Skip() on
OnMouseRightUp)
pressed VK_APPS:
- OnContextMenu with (-1, -1) position
- OnMouseRightUp (probably called by mouse right up event generated in
WM_KEY* for VK_APPS key)
Quote from MSDN:
"DefWindowProc generates the WM_CONTEXTMENU message when it processes
the WM_RBUTTONUP or WM_NCRBUTTONUP message or when the user types SHIFT
+F10. The WM_CONTEXTMENU message is also generated when the user
presses and releases the VK_APPS key."
So, in my opinion, we should delete generate mouse event code from
WM_KEY* (or sign to deprecate/compatible2.8 for existing code and
delete in wx3.0), mapping VK_APPS to VK_MENU and of course using
wxContextMenuEvent in new code ;)
--
Pozdrowienia,
Marcin 'Malcom' Malich
me /at/ malcom.pl
http://malcom.pl
More information about the wx-users
mailing list