Skip to content
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

Percussion keyboard shortcuts #26222

Merged

Conversation

mathesoncalum
Copy link
Contributor

@mathesoncalum mathesoncalum commented Jan 24, 2025

This PR implements our new-and-improved percussion shortcuts. After these changes, it will be possble to use keys beyond ABCDEFG to input percussion notes.



PR Overview

As outlined in the spec for this task, choosing “Define keyboard shortcut” from the percussion panel or editing shortcuts from the Customize kit dialog should prompt the user for an updated shortcut.

While the current flow provided by EditShortcutModel is quite similar to that of the new spec, it's clear that a more specialised model is required for percussion shortcuts (adding extra percussion-specific logic to EditShortcutModel probably wouldn't be appropriate/coherent, especially considering it's part of the framework module). The logic we're interested in also requires some decoupling from preferences.

To address this, 7984f8b extracts the content of our current EditShortcutDialog into an EditShortcutDialogContent component which can be re-used with other models across the application.

 The second commit here (7219ade) implements the EditPercussionShortcutDialog with an associated EditPercussionShortcutModel and provides a logic for opening it in PercussionUtilities.

Commit 6e4ba68 replaces the current shortcut dropdown in the customize kit dialog with a button that triggers the new flow, while commits cff5256 and 4fa176c lay the groundwork for actually using the expanded range of shortcuts for note input.

Finally, dce242c uses NoteInputParams and handleNoteEvent to dispatch percussion shortcuts.

@mathesoncalum mathesoncalum force-pushed the percussion_keyboard_shortcuts branch 4 times, most recently from dcb3ee8 to 6e4ba68 Compare January 24, 2025 16:16
@mathesoncalum mathesoncalum force-pushed the percussion_keyboard_shortcuts branch 3 times, most recently from 38853cc to e88e5ef Compare January 27, 2025 12:34
@mathesoncalum mathesoncalum requested review from Eism and removed request for cbjeukendrup January 27, 2025 13:02
@mathesoncalum mathesoncalum force-pushed the percussion_keyboard_shortcuts branch from e88e5ef to 4fa176c Compare January 27, 2025 15:50
@mathesoncalum mathesoncalum force-pushed the percussion_keyboard_shortcuts branch from 4fa176c to 3b4df9b Compare February 5, 2025 23:45
@mathesoncalum mathesoncalum marked this pull request as ready for review February 6, 2025 16:11
@zacjansheski
Copy link
Contributor

zacjansheski commented Feb 6, 2025

Percussion shortcuts break combo key commands that work in Master when percussion stave is selected. Shift+shortcut override is expected

Most notably Command+A (select all) (resolved)

@mathesoncalum mathesoncalum force-pushed the percussion_keyboard_shortcuts branch from 1d97411 to dce242c Compare February 6, 2025 19:09
@zacjansheski
Copy link
Contributor

Tested on MacOS 15, Windows 11, Ubuntu 22.04.3. Approved

@mathesoncalum mathesoncalum merged commit 975d767 into musescore:master Feb 7, 2025
11 checks passed
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.

4 participants