On 4/4/2011 3:51 PM, Jerry Jacobs wrote:
On 4/4/11 9:41 PM, jean-pierre charras wrote:
Jerry,
Your last change in rev 2945 in file:
common/hotkeys_basic.cpp
breaks Kicad.
The reason is when a key is added in a menu, with a \t before it, it
become a shortcut.
Therefore type is key is exactly equivalent to click on this menu, and
this key is no more sent to the kicad key handler..
I don't know for sure, but for me on OS X all the Placement hotkeys which I
tested (in EESchema) works as expected. With wxWidgets 2.9.2 svn. And don't
break the hotkey internals, correct me if I'm wrong.
Jerry,
It is important understand that hot keys are not the same as menu or tool bar
short cuts. The menu and tool bar commands require an extra left mouse click
to create the object associated with the current tool. Hot keys on the other
hand, create the object immediately at the current cursor position. While your
change may work, it had to change the behavior of the hot key. Your change
would have remapped the hot key to the equivalent place menu command.
This break Kicad, because many hotkeys does not the same thing as you
are click on menus.
Mainly because hot keys use current mouse cursor position (start a wire,
zoom, ...)
and obviously this is not possible when clicking on a menu.
This is true for menus in frame menu bar, not pop up menus, because they
are not active.
So in many cases keys added in menus in the menu bar are only comments,
not shortcuts.
This "bad" comments "break" the Mac UI policy and are a bit ugly compared to
the defaults.
I do agree with you assessment about the comments. Not as much from a UI
policy standpoint as from a behavior standpoint. Pressing the W key to begin
drawing a wire is not the same as selecting the wire tool and left clicking to
begin drawing a wire. They are not the same thing so adding the comment is
confusing.
Please, unless you known (with wxWidgets) how to see the difference
between click on a menu
and click on the corresponding hotkey,
(I do not know how to do that, and if this is possible, because the same
event is sent,
perhaps try to use wxEvent::GetEventType() to do that, but this needs a
lot of changes),
go back to the previous version of common/hotkeys_basic.cpp.
Aesthetic reason to this change is not a good reason, if this change
breaks the previous behavior.
Currently, most of hotkeys are not working properly.
It is no problem to revert back to the previous version of this file.
If that is what you are going to do, please let me know as I have a commit
ready to submit. I hold off until I hear otherwise.