From aae30cc7c198f77360e820b353c6692efe94c809 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sun, 13 May 2018 13:11:11 -0700 Subject: [PATCH] pcbnew: Hotkey minor fixes - Ordering of Hotkey list by function - Use Hotkey assignment instead of hard-coded hotkey for length tuning - Adjust default Length Tuning settings hotkey to CTRL-L so that we don't overlap with "Lock" (overlaps are not editable) --- pcbnew/hotkeys.cpp | 115 ++++++++++++++++++++-------- pcbnew/router/length_tuner_tool.cpp | 7 +- pcbnew/router/router_tool.cpp | 2 +- 3 files changed, 91 insertions(+), 33 deletions(-) diff --git a/pcbnew/hotkeys.cpp b/pcbnew/hotkeys.cpp index c08b8da18e..13394918f3 100644 --- a/pcbnew/hotkeys.cpp +++ b/pcbnew/hotkeys.cpp @@ -106,7 +106,7 @@ static EDA_HOTKEY HkRouteTuneDiffPair( _HKI( "Tune Differential Pair Length (Mod static EDA_HOTKEY HkRouteTuneSkew( _HKI( "Tune Differential Pair Skew (Modern Toolset only)" ), HK_ROUTE_TUNE_SKEW, '9' ); static EDA_HOTKEY HkRouteTuneSettings( _HKI( "Length Tuning Settings (Modern Toolset only)" ), - HK_ROUTE_TUNE_SETTINGS, 'L' ); + HK_ROUTE_TUNE_SETTINGS, 'L' + GR_KB_CTRL ); static EDA_HOTKEY HkAddThroughVia( _HKI( "Add Through Via" ), HK_ADD_THROUGH_VIA, 'V' ); static EDA_HOTKEY HkSelLayerAndAddThroughVia( _HKI( "Select Layer and Add Through Via" ), @@ -314,41 +314,96 @@ EDA_HOTKEY* common_basic_Hotkey_List[] = // List of hotkey descriptors for Pcbnew EDA_HOTKEY* board_edit_Hotkey_List[] = { - &HkTrackDisplayMode, &HkDelete, - &HkBackspace, + // Adding Items + &HkPlaceItem, + &HkAddModule, + + // Routing and options during routing &HkAddNewTrack, + &HkSwitchTrackPosture, + &HkDragTrackKeepSlope, + &HkAddThroughVia, + &HkAddBlindBuriedVia, + &HkAddMicroVia, + + // Routing &HkRouteDiffPair, &HkRouteTuneSingle, &HkRouteTuneDiffPair, &HkRouteTuneSkew, - &HkAddThroughVia, &HkAddBlindBuriedVia, - &HkAddMicroVia, - &HkSelLayerAndAddThroughVia, &HkSelLayerAndAddBlindBuriedVia, - &HkSwitchTrackPosture, - &HkDragTrackKeepSlope, - &HkPlaceItem, &HkCopyItem, - &HkMoveItem, - &HkFlipItem, - &HkRotateItem, &HkRotateItemClockwise, - &HkMoveItemExact, &HkPositionItemRelative, - &HkDuplicateItem, &HkDuplicateItemAndIncrement, &HkCreateArray, - &HkDragFootprint, - &HkGetAndMoveFootprint, &HkLock_Unlock_Footprint, - &HkFindItem, &HkEditBoardItem, - &HkEditWithModedit, - &HkSwitch2CopperLayer, &HkSwitch2InnerLayer1, - &HkSwitch2InnerLayer2, &HkSwitch2InnerLayer3, &HkSwitch2InnerLayer4, - &HkSwitch2InnerLayer5, &HkSwitch2InnerLayer6, &HkSwitch2ComponentLayer, - &HkSwitch2NextCopperLayer, &HkSwitch2PreviousCopperLayer,&HkAddModule, - &HkSwitchTrackWidthToNext, &HkSwitchTrackWidthToPrevious,&HkSwitchGridToFastGrid1, - &HkSwitchGridToFastGrid2, &HkSwitchGridToNext, &HkSwitchGridToPrevious, - &HkSwitchHighContrastMode, - &HkCanvasDefault, &HkCanvasCairo, &HkCanvasOpenGL, - &HkZoneFillOrRefill, &HkZoneRemoveFilled, - &HkSelectConnection, &HkSelectCopper, - &HkRoutingOptions, &HkCustomTrackWidth, &HkDpDimension, - &HkViaSizeInc, &HkViaSizeDec, + + // Routing Options + &HkRoutingOptions, + &HkRouteTuneSettings, + &HkDpDimension, + + // Zones + &HkZoneFillOrRefill, + &HkZoneRemoveFilled, + + // Highlight and display + &HkSelectConnection, + &HkSelectCopper, &HkHighlightNetSelection, + &HkTrackDisplayMode, + + // Adjust track/via sizes + &HkCustomTrackWidth, + &HkSwitchTrackWidthToNext, + &HkSwitchTrackWidthToPrevious, + &HkViaSizeInc, + &HkViaSizeDec, + + // Remove items + &HkDelete, + &HkBackspace, + + // Edit placement + &HkDragFootprint, + &HkCopyItem, + &HkMoveItem, + &HkGetAndMoveFootprint, + &HkMoveItemExact, + &HkPositionItemRelative, + &HkFlipItem, + &HkRotateItem, + &HkRotateItemClockwise, + + &HkSelLayerAndAddThroughVia, + &HkSelLayerAndAddBlindBuriedVia, + + &HkDuplicateItem, + &HkDuplicateItemAndIncrement, + &HkCreateArray, + &HkLock_Unlock_Footprint, + + &HkFindItem, + &HkEditBoardItem, + &HkEditWithModedit, + + // Active Layer + &HkSwitch2ComponentLayer, + &HkSwitch2CopperLayer, + &HkSwitch2InnerLayer1, + &HkSwitch2InnerLayer2, + &HkSwitch2InnerLayer3, + &HkSwitch2InnerLayer4, + &HkSwitch2InnerLayer5, + &HkSwitch2InnerLayer6, + &HkSwitch2NextCopperLayer, + &HkSwitch2PreviousCopperLayer, + + // Grids + &HkSwitchGridToFastGrid1, + &HkSwitchGridToFastGrid2, + &HkSwitchGridToNext, + &HkSwitchGridToPrevious, + + // Display + &HkSwitchHighContrastMode, + &HkCanvasDefault, + &HkCanvasCairo, + &HkCanvasOpenGL, NULL }; diff --git a/pcbnew/router/length_tuner_tool.cpp b/pcbnew/router/length_tuner_tool.cpp index cb5d04468e..e1a4820f01 100644 --- a/pcbnew/router/length_tuner_tool.cpp +++ b/pcbnew/router/length_tuner_tool.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include "pns_segment.h" #include "pns_router.h" @@ -45,13 +46,15 @@ using namespace KIGFX; -static TOOL_ACTION ACT_StartTuning( "pcbnew.LengthTuner.StartTuning", AS_CONTEXT, 'X', +static TOOL_ACTION ACT_StartTuning( "pcbnew.LengthTuner.StartTuning", AS_CONTEXT, + TOOL_ACTION::LegacyHotKey( HK_ADD_NEW_TRACK ), _( "New Track" ), _( "Starts laying a new track." ) ); static TOOL_ACTION ACT_EndTuning( "pcbnew.LengthTuner.EndTuning", AS_CONTEXT, WXK_END, _( "End Track" ), _( "Stops laying the current meander." ) ); -static TOOL_ACTION ACT_Settings( "pcbnew.LengthTuner.Settings", AS_CONTEXT, 'L', +static TOOL_ACTION ACT_Settings( "pcbnew.LengthTuner.Settings", AS_CONTEXT, + TOOL_ACTION::LegacyHotKey( HK_ROUTE_TUNE_SETTINGS ), _( "Length Tuning Settings..." ), _( "Sets the length tuning parameters for currently routed item." ), router_len_tuner_setup_xpm ); diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 3972304d37..0c375e3b20 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -90,7 +90,7 @@ TOOL_ACTION PCB_ACTIONS::routerActivateDiffPair( "pcbnew.InteractiveRouter.DiffP _( "Run push & shove router (differential pairs)" ), ps_diff_pair_xpm, AF_ACTIVATE ); TOOL_ACTION PCB_ACTIONS::routerActivateSettingsDialog( "pcbnew.InteractiveRouter.SettingsDialog", - AS_GLOBAL, 0, + AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ROUTING_OPTIONS ), _( "Interactive Router Settings..." ), _( "Open Interactive Router settings" ), NULL, AF_ACTIVATE );