From 1bc881df6659ab970260d3675128ab44cc2e613f Mon Sep 17 00:00:00 2001 From: dragonmacher <48328597+dragonmacher@users.noreply.github.com> Date: Wed, 13 Jan 2021 12:06:36 -0500 Subject: [PATCH] GP-582 - Key Bindings - fix broken Function Graph key bindings when docked in the main tool Closes #589 --- .../src/main/java/docking/DockingCheckBoxMenuItem.java | 10 ++++++++-- .../Docking/src/main/java/docking/DockingMenuItem.java | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Ghidra/Framework/Docking/src/main/java/docking/DockingCheckBoxMenuItem.java b/Ghidra/Framework/Docking/src/main/java/docking/DockingCheckBoxMenuItem.java index 3e0768ae25..177db1fe8a 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/DockingCheckBoxMenuItem.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/DockingCheckBoxMenuItem.java @@ -1,6 +1,5 @@ /* ### * IP: GHIDRA - * REVIEWED: YES * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,6 +30,13 @@ public class DockingCheckBoxMenuItem extends JCheckBoxMenuItem { @Override protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) { - return true; // we will take care of the action ourselves + // TODO this note doesn't really make sense. I think this idea is outdated. Leaving this + // here for a bit, in case there is something we missed. This code is also in + // DockingMenuItem. + // return true; // we will take care of the action ourselves + + // Our KeyBindingOverrideKeyEventDispatcher processes actions for us, so there is no + // need to have the menu item do it + return false; } } diff --git a/Ghidra/Framework/Docking/src/main/java/docking/DockingMenuItem.java b/Ghidra/Framework/Docking/src/main/java/docking/DockingMenuItem.java index 8c506aa0b5..8abe8eb6c2 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/DockingMenuItem.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/DockingMenuItem.java @@ -33,7 +33,8 @@ public class DockingMenuItem extends JMenuItem implements GComponent { @Override protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) { // TODO this note doesn't really make sense. I think this idea is outdated. Leaving this - // here for a bit, in case there is something we missed + // here for a bit, in case there is something we missed. This code is also in + // DockingCheckboxMenuItemUI. // return true; // we will take care of the action ourselves // Our KeyBindingOverrideKeyEventDispatcher processes actions for us, so there is no