Skip to content

gui: Add keyboard shortcuts to history browser tree - #7423

Open
polucifier wants to merge 3 commits into
OSGeo:mainfrom
polucifier:history-shortcuts
Open

polucifier wants to merge 3 commits into
OSGeo:mainfrom
polucifier:history-shortcuts

Conversation

@polucifier

@polucifier polucifier commented May 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

This Pull Request implements the requested keyboard shortcuts for the history browser tree, improving accessibility and overall user experience. Users who prefer using the keyboard over context menus can now manage their command history much faster.

Key Changes

  • Added Ctrl + C shortcut to copy the selected command to the clipboard.
  • Added Delete shortcut to remove the selected command from the history log.
  • Added Enter and Return key shortcuts (including the numpad) to mimic the double-click behavior.
  • Added safety checks to ensure these shortcuts only trigger on command nodes (COMMAND), preventing accidental modification or deletion of day/time period header nodes (TIME_PERIOD).

Related PRs / Issues

How to Test

  1. Open the History tab in the GRASS GUI.
  2. Select any successfully executed command.
  3. Press Ctrl + C and try pasting it into a text editor to verify it was copied.
  4. Press Delete on a command, confirm the dialog, and verify it was removed.
  5. Try pressing these keys on a date header (e.g., "Today") and verify that nothing happens.

@github-actions github-actions Bot added GUI wxGUI related Python Related code is in Python labels May 22, 2026
@polucifier polucifier changed the title wxgui: Add keyboard shortcuts to history browser tree gui: Add keyboard shortcuts to history browser tree May 22, 2026
@polucifier
polucifier marked this pull request as draft May 23, 2026 17:15
Comment thread gui/wxpython/history/tree.py Outdated
@polucifier
polucifier force-pushed the history-shortcuts branch from e6e75ae to b552d89 Compare May 24, 2026 12:32
@polucifier
polucifier marked this pull request as ready for review May 24, 2026 12:36
@lindakarlovska

Copy link
Copy Markdown
Contributor

Hi! Thanks for implementing this and sorry for the late response (do not be afraid to just call for review :-).
Could you please remove CTRL+D and leave only Delete shortcut (discussed here #5285 (comment))?

@lindakarlovska

Copy link
Copy Markdown
Contributor

Btw, delete shortcuts would be helpful also in other "removing" situations, mainly in Data Catalog, see Delete point in #5425:

• Delete
-- Delete map(s) (Data Catalog – Layer node/s)
-- Delete mapset(s) (Data Catalog – Mapset node/s)
-- Delete project(s) (Data Catalog – Project node/s)
-- Remove GRASS database from data catalog (Data Catalog – GrassDb node)
-- Delete layers(s) (Layers pane – Layer node/s)

• CTRL + Shift + Delete
-- Delete GRASS database from disk (Data Catalog – GrassDb node)

If you want, you are welcome to implementing these as well :-)

@polucifier
polucifier marked this pull request as draft June 30, 2026 15:56
Implement Ctrl+C for copying commands, the Delete key for removing
commands from the history browser tree, and Enter/Return to open a
command in the GUI, equivalent to double-clicking it. This improves
accessibility and UX for users who prefer keyboard shortcuts over
context menus.
Keep only the Delete key, as other software reserves Ctrl+D for
duplicating. See OSGeo#5285 for the
discussion on shortcut conventions.
@polucifier
polucifier marked this pull request as ready for review October 10, 2026 13:18
Move removal of a command to EVT_KEY_UP so that holding the key does not
remove several commands in a row. This matches the layer tree and the
graphical modeler, which handle removal on key up as well. Opening a
command and copying stay on key down.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GUI wxGUI related Python Related code is in Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] wxGUI/history: Keyboard shortcuts for Copying and Deleting Commands

2 participants