From 2cbf7438fa4c4372d3422c7506c159883a93619f Mon Sep 17 00:00:00 2001 From: Zuhri Utama Date: Sat, 14 Oct 2023 20:47:10 +0700 Subject: [PATCH] IDEMPIERE-4671 : Shortcut for the menu box (#2054) --- .../WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java | 2 +- .../src/org/adempiere/webui/panel/HeaderPanel.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java index 8ac4078dbb..79a3ec9a1b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java @@ -339,7 +339,7 @@ public class AdempiereWebUI extends Window implements EventListener, IWeb keyListener = new Keylistener(); keyListener.setPage(this.getPage()); - keyListener.setCtrlKeys("@a@c@d@e@f@h@l@m@n@o@p@q@r@s@t@w@x@z@#left@#right@#up@#down@#home@#end#enter^u@u@#pgdn@#pgup$#f2^#f2"); + keyListener.setCtrlKeys("@a@c@d@e@f@g@h@l@m@n@o@p@q@r@s@t@w@x@z@#left@#right@#up@#down@#home@#end#enter^u@u@#pgdn@#pgup$#f2^#f2"); keyListener.setAutoBlur(false); //create IDesktop instance diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/HeaderPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/HeaderPanel.java index 7588eb0c82..43f7a75d33 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/HeaderPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/HeaderPanel.java @@ -67,6 +67,8 @@ public class HeaderPanel extends Panel implements EventListener private MenuTreePanel menuTreePanel; + private GlobalSearch globalSearch; + /** * Default constructor */ @@ -124,7 +126,7 @@ public class HeaderPanel extends Panel implements EventListener * Create global search box */ protected void createSearchPanel() { - GlobalSearch globalSearch = new GlobalSearch(new MenuSearchController(menuTreePanel.getMenuTree())); + globalSearch = new GlobalSearch(new MenuSearchController(menuTreePanel.getMenuTree())); Component stub = getFellow("menuLookup"); stub.getParent().insertBefore(globalSearch, stub); stub.detach(); @@ -161,7 +163,9 @@ public class HeaderPanel extends Panel implements EventListener popMenu.setFocus(true); }else if (ke.getKeyCode() == 27) { popMenu.close(); - } + }else if (ke.getKeyCode() == 71) { + globalSearch.setFocus(true); + } } else if(event.getName().equals(ZoomEvent.EVENT_NAME)) { Clients.clearBusy(); ZoomEvent ze = (ZoomEvent) event;