Merge pull request #927 from uneasyalliance/X_Q_hotkey_fixes

fix for 'x' hotkey preventing 'x' input in dialogs
This commit is contained in:
uneasyalliance
2025-05-21 16:33:33 -04:00
committed by GitHub
parent 7913df0767
commit c1387a015a
2 changed files with 7 additions and 4 deletions
@@ -90,7 +90,9 @@ public class ExplorerPlugin implements IPlugIn {
@Override
public boolean dispatchKeyEvent(KeyEvent e) {
if (e.getKeyChar() == 'x' && e.getModifiersEx() == 0
if (explorerPane != null
&& (canvasPanel.hasFocus() || explorerPane.hasFocus())
&& e.getKeyChar() == 'x' && e.getModifiersEx() == 0
&& ConfigurationManager.getInstance()
.readBoolean(ConfigPlugin.PROJECT_EXPLORER, true)) {
explorerPane.getSearchField().requestFocusInWindow();
@@ -80,12 +80,13 @@ public class ComponentTree implements IPlugIn {
@Override
public boolean dispatchKeyEvent(KeyEvent e) {
if ((canvasPanel.hasFocus() || treePanel.hasFocus())
&& e.getKeyChar() == 'q'
if (treePanel != null
&& (canvasPanel.hasFocus() || treePanel.hasFocus())
&& e.getKeyChar() == 'q' && e.getModifiersEx() == 0
&& ConfigurationManager.getInstance()
.readString(ConfigPlugin.COMPONENT_BROWSER, ConfigPlugin.SEARCHABLE_TREE)
.equals(ConfigPlugin.SEARCHABLE_TREE)) {
getTreePanel().getSearchField().requestFocusInWindow();
treePanel.getSearchField().requestFocusInWindow();
return true;
}
return false;