Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
GuiActionclass (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 toQAction, it at the moment does not attempt to replace it, even though their functionalities are similar.While
QActioncan 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 possibleActionDatas - useful for viewing and managing keybindings;ActionTrigger: hosts the variant classActionTrigger::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);Progress:
ActionTrigger::KeyPress) - fbd206fActionContainer)QAction- 24ea6afQAction)?