I searched in multiple places (included this feature request area) for a way to change keyboard shortcuts.
I know in the old version of Rosegarden, you could quickly and easily change a huge variety of keyboard shortcuts.
And I loved how your could filter keyboard shortcuts, by searching for their names.
But the new version of Rosegarden does not seem to have ANY menu for changing keyboard shortcuts.
Therefore, my primary feature request is a simple way to change the keyboard shortcuts in Rosegarden.
My secondary feature request, is to re-implement the ability to filter shortcuts by name, that tool was great!
When we ported to Qt, we had some discussions about writing an editor for keyboard shortcuts. We used to get that from KDE automatically.
I forget the story now, but I think somebody had some big ideas and I set them on more important tasks first. This never got done, then those people all drifted away, and have been gone for years.
Putting a shortcut editor together with the fact that our keyboard shortcuts are translated, and can be changed by translators to differ in different languages makes the whole thing seem like an even bigger nightmare than it did before.
Using xdotool it is possible to easily map all the events (including keyboard events) of your personal window to the rosegarden events (including mouse events) so you can define any shortcuts.
Right now, the keyboard shortcuts are hard-coded in the ".rc" files. rosegardenmainwindow.rc contains most of them. But all the other .rc files (especially notation.rc and matrix.rc) should probably be consulted for conflicts as well if you intend to change them.
You can provide your own custom .rc files in your ~/.local/share/rosegarden/rc directory. Copy from the appropriate version of the source and modify. This is, of course, dangerous, but good for trying out shortcut changes temporarily.
Also note that .rc files can appear in /use/share/rosegarden/rc and these can cause problems when upgrading Rosegarden.
Last edit: Ted Felix 2022-02-19
good feature request!
This seems a reasonable feature request. Is it difficult ?
One idea: All the actions go through ActionFileClient/Parser. Have the Parser write the data to a static object (singleton?) This could contain all the data (Text shortcut menu/toolbar icon..) An editor would provide overrides for this data stored in the settings. The parser would then consult this object for overrides and set the shortcuts accordingly.
Seems doable !
The important thing about this is that a lot of users want it. That makes it higher priority than probably all the other feature requests. If you can tackle it, there would be a lot of users who would appreciate it. Right now they are modifying their .rc files, which is not a good idea.
I'm not sure how difficult it is, but it seems rather involved. E.g. we have to be careful about the different shortcuts across the different editors. It's been done on many other Qt projects so I'm sure it's not too difficult. Might be able to look at how others have done this for ideas.
The one thing that everyone complains about is our choice of transport shortcuts. E.g. many users want spacebar to be the usual play/pause. Right now it's punch in/out which not everyone uses. That would probably be the place to start. A set of customizable transport shortcuts that apply to all editors and the main window. See Tools > Transport for the current set of transport shortcuts. (Doing a subset is problematic, though, as it makes it possible to have overlap, but should be fine for a proof of concept.)
It feels like a big project, but if you are up for it, it will be a much appreciated improvement.
I made an initial dialog showing all shortcuts. No edit function yet so not read for merging but if anyone wants to look at it and give suggestions I would be happy
See merge request.
This looks really great. I was able to filter and find that pesky play function that everyone complains about. And I was able to filter on space and find out what the space bar is assigned to. This will be really powerful when it's done. Please keep at it.
https://sourceforge.net/p/rosegarden/git/merge-requests/48/
branch: feature-412-shortcuts
All the filter and sort magic comes from QStandardItemModel and QSortFilterProxyModel.
I have implemented some edit functions.
Still missing:
1. Actually setting the custom shortcuts - should be pretty straightforward but I will leave that until all the editing works.
2. Some checking for double shortcuts - note this may make sense sometimes - see "Y" in the notation editor.
Suggestions and bugs welcome!
See merge request.
Got this crash:
I was just playing around trying to set punch record to "/" so I could get it off the spacebar. Also got a warning dialog that popped up and was completely empty. I assume it was alerting me to a conflict.
I'm going to work up some test cases so I can give you more specific details. This was just my first time clicking on things.
Oh, and here's the DEBUG output. Looks like the -1 for srcIndex.row() wasn't caught:
Procedure to reproduce crash:
Thanks for finding that. Setting the shortcuts can cause the selection to change!!
Yes the dialog is empty at the moment - it will later show shortcut duplicates.
Still very much "work in progress"
Btw. Several classes (eg. TriggerSegmentManager) have a getShortcuts method. This does not seem to be called by anyone. Is there a reason for this ?
None that I can see. Some of them even return the pointer uninitialized. I would just remove them all. They appear to be ancient. Last change was 2008 when Chris renamed them: [954add]. I'd have to dig some more to figure out when they were introduced.
Only
AudioManagerDialog
appears to do anything with this. It creates a shortcut for Delete and connects to it. Is that enough to make a shortcut work? The rest just create aQShortcut(this)
or leave m_shortcuts uninitialized.Related
Commit: [954add]
Ok, so I did the archaeology, and found [4fbef4] from 2002. Apparently those are leftovers from the way accelerators used to work back when they were called
QAccel
. I suspect there may not have been an .rc file back then? Anyway, not really worth figuring out. Definitely worth removing.Related
Commit: [4fbef4]
I will remove them.
I just grabbed the latest, and now I can't get the default values back for Rosegarden main window/play. It becomes completely blank when I press "Reset to Defaults". I have no
[UserShortcuts]
section in my .conf and it still comes up as blank on a fresh run. It's quite strange. It's as if it can't handle the play command's shortcuts. Admittedly it's probably the most complex: "Ctrl+Enter, Enter, Media Play, Ctrl+Return". Maybe something about that is tripping it up?I'm also not getting the "Record" entry anymore when I filter on "space" (with nothing in the .conf file). The default for that one is "Ctrl+Space, Media Record".
"Media" appears to be the common denominator here. With the latest version, if I filter on media, I get nothing.
Going back to commit f0e77b fixes this issue.
Yes - I built in a bug !!
As I say - work in progress.
The latest commit should be better.
Here's my main test case. It's not quite working at the moment, but there is a workaround:
[UserShortcuts]
in the .conf file to make sure we are starting from scratch..
Reassign Punch In Record to nothing.
.
Assign Play to spacebar.
.
Confirm changes and new behavior.
.
If I go through the same process, but set record to "\", spacebar becomes play as expected. So, it appears as if some way to indicate "cleared" or "empty" is needed in the .conf file.
Last edit: Ted Felix 2022-02-15