← Back to team overview

kicad-developers team mailing list archive

'/' hotkey

 

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
diff --git a/pcbnew/hotkeys.cpp b/pcbnew/hotkeys.cpp
index b97f0805d..97e7a4255 100644
--- a/pcbnew/hotkeys.cpp
+++ b/pcbnew/hotkeys.cpp
@@ -198,7 +198,11 @@ static EDA_HOTKEY HkZoomSelection( _HKI( "Zoom to Selection" ), HK_ZOOM_SELECTIO
 
 static EDA_HOTKEY Hk3DViewer( _HKI( "3D Viewer" ), HK_3D_VIEWER, GR_KB_ALT + '3' );
 
+#if defined( __WXMSW__ )
+static EDA_HOTKEY HkHelp( _HKI( "Help (this window)" ), HK_HELP, GR_KB_SHIFT + '?' );
+#else
 static EDA_HOTKEY HkHelp( _HKI( "Help (this window)" ), HK_HELP, '?' );
+#endif
 
 static EDA_HOTKEY HkSwitchTrackWidthToNext( _HKI( "Switch Track Width To Next" ),
                                             HK_SWITCH_TRACK_WIDTH_TO_NEXT, 'W' );

Follow ups