On Thu, 15 May 2014 22:35:04 -0700 (PDT) Paul K wrote:
PK> 1. I recently added F2 as a menu shortcut and ran across the first
PK> issue. The global shortcut is called first on Windows and OSX, so KEY_DOWN
PK> event doesn't get any chance to be checked. It still works on Linux,
PK> because of the changes that are discussed at length in this topic:
PK>
http://wxwidgets.10942.n7.nabble.com/Menu-shortcuts-inconsistentcy-issue-td85065.html.
PK> I was one of the participants and have to say that I didn't like Linux
PK> behavior as it seemed inconsistent to me at that time (and cause issues
PK> with wxSTC behavior on Linux that forced me to put a workaround in place).
PK> I may now reconsider my position, but in any case, the behavior is
PK> different between Linux and Windows/OSX.
It seems that we don't have a Trac ticket for this, but we really ought
to. Could you please create one and attach some code reproducing the
problem? Ideal would be to have a unit test using wxUIActionSimulator
checking for this.
PK> 2. I thought I would just make a simple fix using CHAR_HOOK connected to
PK> the tree control to handle characters before they get to the accelerator
PK> handling. Works on Windows, but not on OSX.
I'm not even sure how should CHAR_HOOK and accelerators combine... But
they clearly should do it in the same way under all platforms.
PK> 3. I then thought that I could attach wxAcceleratorTable to wxTreelCtrl to
PK> handle F2 when the tree control has focus. Works well on Windows, but not
PK> on OSX as it always activates the "local" shortcut (F2 that edits a tree
PK> item) even when a focus is on some other element.
I have no idea how can this happen to be honest. But in any case,
accelerators should really be only used for TLWs and such workarounds
shouldn't be necessary in the first place.
PK> 4. I then thought that I could set the accelerator table on SET_FOCUS event
PK> connected to wxTreeCtrl and remove it on KILL_FOCUS event. Works on
PK> Windows, but doesn't work on OSX as the KILL_FOCUS event never comes;
PK> probably related to #14269 and #14142.
...
PK> I'd also like to talk briefly about the state of some of these issues. Two
PK> of the tickets related to missing KILL_FOCUS event had been opened two
PK> years ago and last updated more than a year ago. I understand Vadim's
PK> position to avoid raizing priority on those tickets that don't have people
PK> that can work on them, but setting high priority can be useful in two ways:
PK> when we do get people working on them, they can focus on those issues and
PK> if we don't have resources, maybe we can get some external help when we can
PK> point to specific high priority issues that need fixes. In fact, I'd
PK> consider chiming in with some bounty money and although it's a slippery
PK> slope if we start paying for tickets, I'm not against it and had a bounty
PK> for my own project for a particularly tricky problem (although it wasn't
PK> claimed).
I agree that those are important bugs, so I did increase #14269 priority
(but closes #14142 as it seems to be the exact duplicate). I still can't
fix this myself though.
Regards,
VZ