← Back to team overview

kicad-developers team mailing list archive

Re: '/' hotkey

 

Le 28/02/2018 à 17:45, Wayne Stambaugh a écrit :
> In the process of attempting to fix this bug[1], I ran into an issue
> with the '/' hotkey for all main frames.  For some reason, the hotkey
> help dialog is being displayed for both '/' and '?' keys which broke the
> track posture switching in pcbnew.  This bug only seems to affect
> windows.  The attached patch fixes the issue but changes the menu entry
> shortcut text from '?' to 'shift+?' which would make pcbnew different
> from all of the other mainframe windows which is ugly but it's better
> than a broken hotkey.
> 
> While I was at it, I took a look at the schematic editor and sure enough
> the same behavior exists except that the same change as the attached
> patch does not fix the issue so the bus wire entry hotkey is broken.
> When I set a debugger breakpoint in the EDA_DRAW_PANEL::OnKeyEvent()
> function, it is not triggered for either a '/' key.  The '?' key does
> trigger the breakpoint.  Did someone create a character hook somewhere
> that could be preventing EDA_DRAW_PANEL from ever receiving the '/' key
> presses and passing them directly to the SCH_EDIT_FRAME?  I cannot find
> any reason why the EDA_DRAW_PANEL::OnKeyEvent() event handler is not
> being called for this key on windows.
> 
> Cheers,
> 
> Wayne
> 
> [1]: https://bugs.launchpad.net/kicad/+bug/1751812

Wayne,
Because the hotkeys can be redefined by user, I don't think your fix is working.

Moreover it happen mainly in US keyboards
(I am guessing the chars '?' and '/' are the same keyboard key)

On Windows, the key events are really tricky, and I never be able to fix the accelerators versus
hotkeys issues.

In this case the issue is due to the complexity of keys events:
The simplified event list is:

- first the EVT_CHAR_HOOK_EVENT is send with key code = '/'
if not captured:
- send EVT_CHAR_EVENT is send with key code = '?'

and in fact there are more events sent, both using EVT_CHAR_HOOK_EVENT and EVT_CHAR_EVENT.

This is true for each key: a event is send with code corresponding to the non shifted code, and then
to the shifted code (if the envent is not captured)

-- 
Jean-Pierre CHARRAS


Follow ups

References