-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User configurable shortcuts #11
Comments
Some more implementation considerations:
Open points
|
As this is not a new topic, I want to collect what I can find in existing (open and closed) issues and pull requests:
There are much more, mainly closed as duplicates. Let me categorize them as far as I understand them:
In this issue I want to concentrate on the first two: make the shortcuts configurable and also use mouse and stylus buttons to trigger actions. Number three requires new actions, which will not be the primary purpose of this issue. |
Here is the initial draft of a user interface for configurable shortcuts:
@kaamui: I would really appreciate your feedback - and that of any other user, too! |
I'll try to look at it asap. It looks great ! Thank you a lot for the help you provide to this project. |
Thanks for your feedback. Currently the code is not complete, but I want to check that I'm going in the right direction. I will inform you when I have pushed something working. I'm currently also thinking whether I could also include a feature to configure keys and buttons which modify tool behavior when pressed, as this was also often requested (e.g. panning, switching to eraser, etc). I will for sure not implement those features, but at least a framework to configure the keys and buttons used for such things if they will come in the future. |
Further TODOs:
|
@kaamui The current status at https://github.com/letsfindaway/OpenBoard/tree/shortcut-configuration are ready to give you an impression of the current status of my work. I just opened a draft pull request OpenBoard-org#460, as I would like to have intensive testing on other platforms by other users. Further points:
|
About this particular point (no need for ctrl), where the focus needs to be for the shortcut to be triggered ? Is it automatically handled by Qt that when focus is on an editable QGraphicsTextItem it should not be triggered ? Are the events "attached" to a global handler that is listening or does it need to be attached to every view ? |
tl;dr: it works! Longer explanation: I'm not the Qt event handling expert, but what I understood from the documentation and all my tests is the following:
Currently most actions are attached to buttons. Therefore shortcuts only work, when the buttons are visible. I'm additionally attaching the actions to the main window. Actions can be attached to multiple widgets, which makes them accessible when at least one of those widgets is visible and enabled. So the shortcuts are also working when the associated button is not visible, because visibility of the main window is sufficient. The option "Ignore Ctrl" adds secondary shortcuts to the actions. So an action with shortcut "Ctrl+B" gets a secondary shortcut "B". What happens when the I think the important fact is, that the shortcut check for actions attached to the main window is only executed when the key event was not handled by an active child widget before. Please correct me if I'm wrong, but this is what I have understood. |
Hi, Thanks for your work, and the time you take to answer. I'll try to look at your work as soon as I can. |
Instead of the This will work with all shortcuts of the tool palette and in addition to the function where pressing a shortcut key combination switches permanently to a new tool. The distinguishing of the behavior is based on time: When the keys are pressed longer than the keyboard autorepeat interval, then the temporary switching will be activated. |
The ability to configure the shortcuts to trigger actions is one of the often requested features for OpenBoard. In this issue I will collect some of the ideas for implementing this.
An example of a shortcut configuration dialog can be seen in QtCreator. Here a screenshot of the relevant part:
The dialog consists of a table of all actions, grouped in topics. For each action, the name, a description and the currently assigned shortcut is listed. Above the table there is a text field to filter the shortcuts by name. When a row is selected, the shortcut is shown in a text input field below the table. Here it can be literally edited, or the key combination can be recorded. There is also a button to reset the shortcut to the application default. Below the table, the dialog also offers the option to import or export shortcut definitions.
Not shown on the screenshot: When a shortcut was modified, it is shown in bold italic. During entry, it is checked for correctness and a warning message is shown below the input field. Here also a message is shown when an entry collides with other shortcut definitions.
Special ideas for OpenBoard:
Ctrl
key, i.e.E
switches to eraser, notCtrl+E
.QAction
shortcut is defined by aQKeySequence
, and this can only represent keyboard keys! We could however send mouse events and tablet events first to the shortcut manager, which filters them and intercepts those used for a shortcut.Questions coming into my mind:
UBActionPalette
objects. This could be a very useful and natural grouping for those actions.@kaamui: feel free to comment! Too complicated? Other features needed? Your ideas?!
The text was updated successfully, but these errors were encountered: