This is an automated email from the ASF dual-hosted git repository.

hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git


The following commit(s) were added to refs/heads/main by this push:
     new 448efeb268 fix duplicate shortcut, add some missing shortcuts, cleanup 
dialog, fixes #6454 (#6466)
448efeb268 is described below

commit 448efeb2685b038b67d516c8446f4f725e7d9aa5
Author: Hans Van Akelyen <[email protected]>
AuthorDate: Tue Jan 27 10:56:16 2026 +0100

    fix duplicate shortcut, add some missing shortcuts, cleanup dialog, fixes 
#6454 (#6466)
---
 .../modules/ROOT/pages/hop-gui/shortcuts.adoc      |  73 +-------------
 .../main/java/org/apache/hop/ui/hopgui/HopGui.java |   7 +-
 .../hopgui/file/pipeline/HopGuiPipelineGraph.java  |   3 +
 .../hopgui/file/workflow/HopGuiWorkflowGraph.java  |   5 +
 .../tabs/ConfigKeyboardShortcutsTab.java           | 108 ++++++++++++++++++---
 .../perspective/execution/DragViewZoomBase.java    |   7 ++
 6 files changed, 114 insertions(+), 89 deletions(-)

diff --git a/docs/hop-user-manual/modules/ROOT/pages/hop-gui/shortcuts.adoc 
b/docs/hop-user-manual/modules/ROOT/pages/hop-gui/shortcuts.adoc
index 4fc08371bd..a41adcf959 100644
--- a/docs/hop-user-manual/modules/ROOT/pages/hop-gui/shortcuts.adoc
+++ b/docs/hop-user-manual/modules/ROOT/pages/hop-gui/shortcuts.adoc
@@ -16,77 +16,8 @@ under the License.
 ////
 [[Shortcuts]]
 :imagesdir: ../assets/images
-:description: A lot of actions in Hop can be performed significantly faster 
through keyboard shortcuts. This page provides an overview of all the available 
keyboard shortcuts in Hop Gui.
+:description: A lot of actions in Hop can be performed significantly faster 
through keyboard shortcuts.
 
 = Hop Shortcuts
 
-The table below lists the main shortcuts in Hop.
-Using them will save you a lot of time while working with Hop.
-
-NOTE: If you are a Mac user, please be aware that the Mac keys must be used.
-Most of the times you can replace ctrl with cmd.
-
-== General Shortcuts
-
-[width="85%",cols="25%, 75%",options="header"]
-|===
-|Shortcut|Action
-|Ctr + n |Create a new work item
-|Ctrl + o |Open a work item
-|Ctrl + s |Save a work item
-|Ctrl + Shift + F5|Open the Metadata Explorer Menu
-|Ctrl + Space|Opens the variables popup (**NOTE**: only environment variables 
and variables with the JVM scope are shown here. Variables that are created in 
pipeline or workflow with a parent, grant parent or root workflow job need to 
be entered manually))
-|Ctrl + w |Close a work item
-|Ctrl + q |Quit Hop
-|Ctrl + z |Undo last change
-|Ctrl + Shift + z |Redo last change
-|Ctrl + a |Select all items in work item
-|ESC|Unselect all items in work item
-|Ctrl + f |Search the Hop Gui for something
-|Ctrl + c |Copy an object
-|Ctrl + v |Paste an object
-|Ctrl + x |Cut an object
-|DEL|Delete an object
-|Alt + <-|Navigate to the previous file
-|Alt + ->|Navigate to the next file
-|Alt + o|Close the current dialog (similar to pressing the `Ok` button)
-|F8|Execute work item
-|===
-
-== Pipeline and Workflow Shortcuts
-
-[width="85%",cols="30%, 70%",options="header"]
-|===
-|Shortcut|Action
-|Ctrl + HOME|Align all items to the specified grid side
-|Ctrl + <-|Align all items on the canvas with the left-most selected in the 
selection.
-|Ctrl + ->|Align all items on the canvas with the right-most selected in the 
selection.
-|Ctrl + &uarr;|Align all items on the canvas with the top-most selected in the 
selection.
-|Ctrl + &darr;|Align all items on the canvas with the bottom-most selected in 
the selection.
-|Alt + ->|Distribute the selected items evenly between the left-most and 
right-most item in your selection.
-|Alt + &uarr;|Distribute the selected items evenly between the up-most and 
down-most item in your selection.
-|Ctrl + =|Zoom In on your canvas
-|Ctrl + -|Zoom out on your canvas
-|Ctrl + 0|Reset the zoom percentage to 100%
-|Ctrl + Click|On hops to quickly enable/disable
-|Ctrl + Shift + Click|On hops to quickly delete it
-|Ctrl + Shift + Click|Use this shortcut on workflow actions and pipeline 
transforms that use another workflow or pipeline to open.
-|mouse over + z|Hover over a workflow action or pipeline transform that uses 
another workflow or pipeline to open (similar to option above)
-|mouse over transform + space|Opens the outgoing fields
-|===
-
-== Perspective Shortcuts
-
-[width="85%",cols="30%, 70%",options="header"]
-|===
-|Shortcut|Action
-|Ctrl + Shift + &uarr; | Switch one perspective up
-|Ctrl + Shift + &darr; |Switch one perspective down
-|Ctrl + Shift + d |Open the Data Orchestration Perspective
-|Ctrl + Shift + i |Open the Execution Information Perspective
-|Ctrl + Shift + m |Open the Metadata Perspective
-|Ctrl + Shift + e |Open the File Explorer Perspective
-|Ctrl + f |Open the Search Perspective
-|none|Open the Plugin Perspective
-|none|Open the Neo4j Perspective
-|===
+Shortcuts can now be found inside the application itself, In the setting 
perspective there is a tab named Keyboard Shortcuts that will give you an 
overview of the shortcuts and where to use them.
diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/HopGui.java 
b/ui/src/main/java/org/apache/hop/ui/hopgui/HopGui.java
index 7f1f8deb52..63c59776bc 100644
--- a/ui/src/main/java/org/apache/hop/ui/hopgui/HopGui.java
+++ b/ui/src/main/java/org/apache/hop/ui/hopgui/HopGui.java
@@ -1111,7 +1111,8 @@ public class HopGui
       parentId = ID_MAIN_MENU_EDIT_PARENT_ID,
       image = "ui/images/arrow-left.svg",
       separator = true)
-  @GuiKeyboardShortcut(alt = true, key = SWT.ARROW_LEFT)
+  @GuiKeyboardShortcut(control = true, alt = true, key = SWT.ARROW_LEFT)
+  @GuiOsxKeyboardShortcut(command = true, alt = true, key = SWT.ARROW_LEFT)
   public void menuEditNavigatePreviousFile() {
     getActivePerspective().navigateToPreviousFile();
   }
@@ -1122,7 +1123,8 @@ public class HopGui
       label = "i18n::HopGui.Menu.Edit.Navigate.Next",
       parentId = ID_MAIN_MENU_EDIT_PARENT_ID,
       image = "ui/images/arrow-right.svg")
-  @GuiKeyboardShortcut(alt = true, key = SWT.ARROW_RIGHT)
+  @GuiKeyboardShortcut(control = true, alt = true, key = SWT.ARROW_RIGHT)
+  @GuiOsxKeyboardShortcut(command = true, alt = true, key = SWT.ARROW_RIGHT)
   public void menuEditNavigateNextFile() {
     getActivePerspective().navigateToNextFile();
   }
@@ -1143,6 +1145,7 @@ public class HopGui
       image = "ui/images/run.svg",
       parentId = ID_MAIN_MENU_RUN_PARENT_ID)
   @GuiKeyboardShortcut(key = SWT.F8)
+  @GuiOsxKeyboardShortcut(key = SWT.F8)
   public void menuRunStart() {
     getActiveFileTypeHandler().start();
   }
diff --git 
a/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java
 
b/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java
index 1ed0f0142f..35a055e262 100644
--- 
a/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java
+++ 
b/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java
@@ -4065,6 +4065,7 @@ public class HopGuiPipelineGraph extends 
HopGuiAbstractGraph
       image = "ui/images/check.svg",
       separator = true)
   @GuiKeyboardShortcut(key = SWT.F7)
+  @GuiOsxKeyboardShortcut(key = SWT.F7)
   public void checkPipeline() {
 
     // Show the results views
@@ -5267,6 +5268,7 @@ public class HopGuiPipelineGraph extends 
HopGuiAbstractGraph
   }
 
   @GuiKeyboardShortcut(key = SWT.ESC)
+  @GuiOsxKeyboardShortcut(key = SWT.ESC)
   @Override
   public void unselectAll() {
     clearSettings();
@@ -5296,6 +5298,7 @@ public class HopGuiPipelineGraph extends 
HopGuiAbstractGraph
   }
 
   @GuiKeyboardShortcut(key = SWT.DEL)
+  @GuiOsxKeyboardShortcut(key = SWT.DEL)
   @Override
   public void deleteSelected() {
     // Only handle delete if a pipeline graph item was the last selected item
diff --git 
a/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java
 
b/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java
index af11450392..a99063517a 100644
--- 
a/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java
+++ 
b/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java
@@ -2077,6 +2077,7 @@ public class HopGuiWorkflowGraph extends 
HopGuiAbstractGraph
   }
 
   @GuiKeyboardShortcut(key = SWT.ESC)
+  @GuiOsxKeyboardShortcut(key = SWT.ESC)
   @Override
   public void unselectAll() {
     clearSettings();
@@ -2105,6 +2106,7 @@ public class HopGuiWorkflowGraph extends 
HopGuiAbstractGraph
   }
 
   @GuiKeyboardShortcut(key = SWT.DEL)
+  @GuiOsxKeyboardShortcut(key = SWT.DEL)
   @Override
   public void deleteSelected() {
     // Only handle delete if a workflow graph item was the last selected item
@@ -3317,6 +3319,7 @@ public class HopGuiWorkflowGraph extends 
HopGuiAbstractGraph
       image = "ui/images/undo.svg",
       separator = true)
   @GuiKeyboardShortcut(control = true, key = 'z')
+  @GuiOsxKeyboardShortcut(command = true, key = 'z')
   @Override
   public void undo() {
     workflowUndoDelegate.undoWorkflowAction(this, workflowMeta);
@@ -3330,6 +3333,7 @@ public class HopGuiWorkflowGraph extends 
HopGuiAbstractGraph
       toolTip = "i18n:org.apache.hop.ui.hopgui:HopGui.Toolbar.Redo.Tooltip",
       image = "ui/images/redo.svg")
   @GuiKeyboardShortcut(control = true, shift = true, key = 'z')
+  @GuiOsxKeyboardShortcut(command = true, shift = true, key = 'z')
   @Override
   public void redo() {
     workflowUndoDelegate.redoWorkflowAction(this, workflowMeta);
@@ -3610,6 +3614,7 @@ public class HopGuiWorkflowGraph extends 
HopGuiAbstractGraph
       image = "ui/images/check.svg",
       separator = true)
   @GuiKeyboardShortcut(key = SWT.F7)
+  @GuiOsxKeyboardShortcut(key = SWT.F7)
   public void checkWorkflow() {
     // Show the results views
     //
diff --git 
a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/configuration/tabs/ConfigKeyboardShortcutsTab.java
 
b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/configuration/tabs/ConfigKeyboardShortcutsTab.java
index 23d30e748e..38dae0cd99 100644
--- 
a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/configuration/tabs/ConfigKeyboardShortcutsTab.java
+++ 
b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/configuration/tabs/ConfigKeyboardShortcutsTab.java
@@ -283,20 +283,39 @@ public class ConfigKeyboardShortcutsTab {
     keysComposite.setLayoutData(fdKeys);
 
     // Add modifier keys and main key
-    // Standard order: Control, Alt, Command, Shift (Command before Shift for 
better readability)
+    // Standard order for macOS: Command, Shift, Alt, Control (Apple 
convention)
+    // Standard order for other OS: Control, Alt, Shift
     boolean isMacOS = Const.isOSX();
     Control lastKey = null;
-    if (shortcut.isControl()) {
-      lastKey = createKeyBadge(keysComposite, isMacOS ? "⌃" : "Ctrl", lastKey, 
margin);
-    }
-    if (shortcut.isAlt()) {
-      lastKey = createKeyBadge(keysComposite, isMacOS ? "⌥" : "Alt", lastKey, 
margin);
-    }
-    if (shortcut.isCommand()) {
-      lastKey = createKeyBadge(keysComposite, isMacOS ? "⌘" : "Cmd", lastKey, 
margin);
-    }
-    if (shortcut.isShift()) {
-      lastKey = createKeyBadge(keysComposite, isMacOS ? "⇧" : "Shift", 
lastKey, margin);
+
+    if (isMacOS) {
+      // macOS order: Command first, then Shift, then Alt/Option, then Control
+      if (shortcut.isCommand()) {
+        lastKey = createKeyBadge(keysComposite, "⌘", lastKey, margin);
+      }
+      if (shortcut.isShift()) {
+        lastKey = createKeyBadge(keysComposite, "⇧", lastKey, margin);
+      }
+      if (shortcut.isAlt()) {
+        lastKey = createKeyBadge(keysComposite, "⌥", lastKey, margin);
+      }
+      if (shortcut.isControl()) {
+        lastKey = createKeyBadge(keysComposite, "⌃", lastKey, margin);
+      }
+    } else {
+      // Windows/Linux order: Control, Alt, Shift, Command
+      if (shortcut.isControl()) {
+        lastKey = createKeyBadge(keysComposite, "Ctrl", lastKey, margin);
+      }
+      if (shortcut.isAlt()) {
+        lastKey = createKeyBadge(keysComposite, "Alt", lastKey, margin);
+      }
+      if (shortcut.isShift()) {
+        lastKey = createKeyBadge(keysComposite, "Shift", lastKey, margin);
+      }
+      if (shortcut.isCommand()) {
+        lastKey = createKeyBadge(keysComposite, "Cmd", lastKey, margin);
+      }
     }
 
     // Add the main key
@@ -346,13 +365,50 @@ public class ConfigKeyboardShortcutsTab {
     }
     fdKey.top = new FormAttachment(0, 0);
     fdKey.bottom = new FormAttachment(100, 0);
-    // Set width based on text length - Unicode symbols need less space than 
text labels
-    fdKey.width = text.length() <= 1 ? 24 : text.length() * 14 + 12;
+    // Set width based on key category
+    fdKey.width = getBadgeWidth(text);
     key.setLayoutData(fdKey);
 
     return key;
   }
 
+  /**
+   * Determines the appropriate badge width based on the key text category.
+   *
+   * @param text The key text
+   * @return The badge width in pixels
+   */
+  private int getBadgeWidth(String text) {
+    // Category 1: Modifier and special keys (Ctrl, Alt, Shift, Del, Home, 
etc.)
+    if (text.equals("Ctrl")
+        || text.equals("Alt")
+        || text.equals("Cmd")
+        || text.equals("Shift")
+        || text.equals("Del")
+        || text.equals("Home")
+        || text.equals("End")
+        || text.equals("PgUp")
+        || text.equals("PgDn")
+        || text.equals("Ins")
+        || text.equals("Esc")
+        || text.equals("Space")) {
+      return 60;
+    }
+
+    // Category 2: Function keys (F1-F20)
+    if (text.startsWith("F") && text.length() >= 2 && text.length() <= 3) {
+      try {
+        Integer.parseInt(text.substring(1));
+        return 45;
+      } catch (NumberFormatException e) {
+        // Not a function key
+      }
+    }
+
+    // Category 3: Single characters, digits, symbols, and Unicode modifier 
symbols
+    return 32;
+  }
+
   /**
    * Converts a key code to a readable string.
    *
@@ -362,6 +418,26 @@ public class ConfigKeyboardShortcutsTab {
   private String getKeyText(int keyCode) {
     boolean isMacOS = Const.isOSX();
 
+    // Keypad key conversions (match the logic in HopGuiKeyHandler)
+    if (keyCode == SWT.KEYPAD_ADD) {
+      return "+";
+    } else if (keyCode == SWT.KEYPAD_SUBTRACT) {
+      return "-";
+    } else if (keyCode == SWT.KEYPAD_MULTIPLY) {
+      return "*";
+    } else if (keyCode == SWT.KEYPAD_DIVIDE) {
+      return "/";
+    } else if (keyCode == SWT.KEYPAD_EQUAL) {
+      return "=";
+    } else if (keyCode == SWT.KEYPAD_DECIMAL) {
+      return ".";
+    } else if (keyCode == SWT.KEYPAD_CR) {
+      return "↵";
+    } else if (keyCode >= SWT.KEYPAD_0 && keyCode <= SWT.KEYPAD_9) {
+      // Keypad 0-9
+      return String.valueOf(keyCode - SWT.KEYPAD_0);
+    }
+
     // Spacebar
     if (keyCode == 32) {
       return "Space";
@@ -378,8 +454,8 @@ public class ConfigKeyboardShortcutsTab {
     else if (keyCode == 127) {
       return isMacOS ? "⌫" : "Del";
     }
-    // Digit
-    else if ((keyCode >= 48 && keyCode <= 57) || "+-/*".indexOf(keyCode) >= 0) 
{
+    // Digit and common symbols
+    else if ((keyCode >= 48 && keyCode <= 57) || "+-/*=".indexOf(keyCode) >= 
0) {
       return String.valueOf((char) keyCode);
     }
 
diff --git 
a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/DragViewZoomBase.java
 
b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/DragViewZoomBase.java
index e5bc06127e..7bf3a19d36 100644
--- 
a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/DragViewZoomBase.java
+++ 
b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/DragViewZoomBase.java
@@ -103,6 +103,7 @@ public abstract class DragViewZoomBase extends Composite {
   }
 
   @GuiKeyboardShortcut(control = true, key = '+')
+  @GuiOsxKeyboardShortcut(command = true, key = '+')
   public void zoomIn() {
     magnification += 0.1f;
     // Minimum 1000%
@@ -152,11 +153,13 @@ public abstract class DragViewZoomBase extends Composite {
 
   // Double keyboard shortcut zoom in '+' or '='
   @GuiKeyboardShortcut(control = true, key = '=')
+  @GuiOsxKeyboardShortcut(command = true, key = '=')
   public void zoomIn2() {
     zoomIn();
   }
 
   @GuiKeyboardShortcut(control = true, key = '-')
+  @GuiOsxKeyboardShortcut(command = true, key = '-')
   public void zoomOut() {
     magnification -= 0.1f;
     // Minimum 10%
@@ -202,6 +205,7 @@ public abstract class DragViewZoomBase extends Composite {
   }
 
   @GuiKeyboardShortcut(control = true, key = '0')
+  @GuiOsxKeyboardShortcut(command = true, key = '0')
   public void zoom100Percent() {
     magnification = 1.0f;
     validateOffset();
@@ -211,11 +215,13 @@ public abstract class DragViewZoomBase extends Composite {
 
   // Double keyboard shortcut zoom 100% '0' or keypad 0
   @GuiKeyboardShortcut(control = true, key = SWT.KEYPAD_0)
+  @GuiOsxKeyboardShortcut(command = true, key = SWT.KEYPAD_0)
   public void zoom100Percent2() {
     zoom100Percent();
   }
 
   @GuiKeyboardShortcut(control = true, key = '*')
+  @GuiOsxKeyboardShortcut(command = true, key = '*')
   public void zoomFitToScreen() {
     if (maximum.x <= 0 || maximum.y <= 0) {
       return;
@@ -243,6 +249,7 @@ public abstract class DragViewZoomBase extends Composite {
 
   // Double keyboard shortcut zoom fit to screen '*' or keypad *
   @GuiKeyboardShortcut(control = true, key = SWT.KEYPAD_MULTIPLY)
+  @GuiOsxKeyboardShortcut(command = true, key = SWT.KEYPAD_MULTIPLY)
   public void zoomFitToScreen2() {
     zoomFitToScreen();
   }

Reply via email to