Skip to content

Improved action system#8272

Draft
yohannd1 wants to merge 12 commits intoLMMS:masterfrom
yohannd1:better-actions
Draft

Improved action system#8272
yohannd1 wants to merge 12 commits intoLMMS:masterfrom
yohannd1:better-actions

Conversation

@yohannd1
Copy link
Contributor

@yohannd1 yohannd1 commented Feb 19, 2026

Warning: this is a VERY early draft of the feature, still under planning (hence why all the TODOs here - suggestions very welcome!). Marking this here so I can "log" the progress to help me keep track of how things are doing, and to allow a bit more visibility on the topic.


This PR introduces mainly the GuiAction class (TODO: better name), whose purpose is to listen for keypresses and similar events related to actions that can be activated & deactivated throughout the code. Alhough the name is similar to QAction, it at the moment does not attempt to replace it, even though their functionalities are similar.

While QAction can listen to keypresses, it cannot, for example, detect when a key has been released, or be used to orchestrate a click or drag operation. The purpose of this PR is then to allow that without "over-using" event handlers (TODO: explain my point. this is a bit too vague), and in turn easily allowing customizable keybindings.

Along with said class I also added the following:

  • ActionData: stores information about an action;
  • ActionContainer: stores (statically) all the possible ActionDatas - useful for viewing and managing keybindings;
  • ActionTrigger: hosts the variant class ActionTrigger::Any, which is a sum type of the following:
    • KeyPressed: action is triggered upon key press (auto-repeat configurable);
    • KeyHeld: action is triggered upon key press and release (different signals for each);
    • TODO: put more here. mouse related, iirc

Progress:

  • Simple implementation with support for keypresses (ActionTrigger::KeyPress) - fbd206f
  • Gather all keybindings (with ActionContainer)
  • Keybinding modification proof-of-concept - 596f9a4
  • Fit design in the place of other places that currently use QAction - 24ea6af
  • Where would this approach be useful, other than the normal keypresses (which can already be detected through QAction)?
    • Piano roll keyboard input?
    • "Universal" workspace panning #8203
    • Think about conditions and action processing order (the latter may not matter if there is no intersection between keybindings)
  • Make menu to customize keybindings, and save to config file (not sure if this is in the scope of the PR, might be)
    • Might imply need for categorizing and sorting the keybindings

@yohannd1 yohannd1 changed the title Better actions Improved action system Feb 19, 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.

1 participant