Skip to content

Introduce centralized shortcut handling#642

Open
marvinoe21 wants to merge 3 commits intomasterfrom
641-add-evaluation-and-interrupt-shortcuts-to-gtlabs-shortcut-list
Open

Introduce centralized shortcut handling#642
marvinoe21 wants to merge 3 commits intomasterfrom
641-add-evaluation-and-interrupt-shortcuts-to-gtlabs-shortcut-list

Conversation

@marvinoe21
Copy link
Copy Markdown
Collaborator

@marvinoe21 marvinoe21 commented Dec 3, 2025

This PR introduces a centralized shortcut handling for the Python Module.

All module-related shortcuts (Evaluate Script and Interrupt Evaluation) are now registered in GTlab’s shortcut list and accessed through centralized functions. This ensures consistent shortcut usage across the Python Module.

Closes #641

@marvinoe21 marvinoe21 linked an issue Dec 3, 2025 that may be closed by this pull request
@marvinoe21 marvinoe21 requested a review from rainman110 December 3, 2025 11:53
@marvinoe21
Copy link
Copy Markdown
Collaborator Author

@rainman110 In future features I will need to use these shortcuts again, so having a centralized shortcut handling will be helpful.

Comment thread src/module/utilities/gtpy_shortcut.cpp Outdated

registerShortCut(id::EVAL, {Qt::CTRL + Qt::Key_E});
registerShortCut(id::INTERRUPT, {Qt::CTRL + Qt::Key_I});
registerShortCut(id::SAVE, {Qt::CTRL + Qt::Key_S});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't this bite with GTlab's own STRG+S save command?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it doesn’t, since the shortcut is added to the Python Module category, while GTlab’s own Strg+S is in the Core category. However, there is a known issue with the saving behavior in the Python Task wizard. It is described in #86. I think this should be fixed in a separate PR.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rainman110 In PR #643, the Python wizard was updated so that the Save button and its local Strg+S shortcut were removed. This resolves the previous confusion caused by inconsistent Strg+S behavior. I will also remove the Strg+S shortcut registration from here.

@marvinoe21 marvinoe21 marked this pull request as draft December 5, 2025 13:37
@marvinoe21 marvinoe21 marked this pull request as ready for review December 5, 2025 14:00
@marvinoe21 marvinoe21 added this to the 1.9.0 milestone Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add evaluation and interrupt shortcuts to GTlab’s shortcut list

2 participants