Virtual key mapping

Marcin 'Malcom' Malich malcompl at gmail.com
Wed May 7 03:39:12 PDT 2008



On 7 Maj, 01:51, Vadim Zeitlin <va... at wxwidgets.org> wrote:

> MMM> I added handle to wxEVT_CONTEXT_MENU in app.
> MMM>
> MMM> mouse button right up:
> MMM> - OnMouseRightUp
> MMM> - OnContextMenu with cursor position (called only if event.Skip() on
> MMM> OnMouseRightUp)
> MMM>
> MMM> pressed VK_APPS:
> MMM> - OnContextMenu with (-1, -1) position
> MMM> - OnMouseRightUp (probably called by mouse right up event generated in
> MMM> WM_KEY* for VK_APPS key)
>
>  Yes, this behaviour is expected. Or did I miss something?

OnMouseRightUp on pressed VK_APPS is not necessary, wxgtk and other
port (probably) no generate it.

> MMM> So, in my opinion, we should delete generate mouse event code from
> MMM> WM_KEY* (or sign to deprecate/compatible2.8 for existing code and
> MMM> delete in wx3.0),
>
>  I don't really see any reason to do this, what's the harm in keeping it?
> This change would break the existing code silently (you can't ensure that
> the code using this feature would generate compilation warnings or errors)
> and this is the worst kind of breakage possible so there should be really a
> very good reason to do it.

The generate mouse event is not necessary, the code should by using
wxContextMenu for showing popup menu, no mosuse handlign event.
Ofcourse it will ruin compatibility with older code that uses wx, but
developer should take it into consideration every time he changes
library's version he's using.
It would be a good habit to make some migration notes, which would
cover functionality that was changed and which could cause problems
with existing code.

In my opinion wx3 should supporting exception, namespace and other
language features ;)

> MMM> mapping VK_APPS to VK_MENU

Sorry for my mistake. Mapping VK_APPS to WXK_MENU.

>  If you can write and test a (presumably very simple) patch needed to do
> this, I'd be glad to apply it.

Ok, I'll write the patch in free time.

--
Pozdrowienia,
 Marcin 'Malcom' Malich
 me /at/ malcom.pl
 http://malcom.pl


More information about the wx-users mailing list