mixxxdj / mixxx

Mixxx is Free DJ software that gives you everything you need to perform live mixes.
http://mixxx.org
Other
4.25k stars 1.24k forks source link

Usability: Add Ctrl+Shift+F shortcut to search the main tracks database #13200

Open cr7pt0gr4ph7 opened 2 months ago

cr7pt0gr4ph7 commented 2 months ago

The new shortcut Ctrl+Shift+F (Search globally[^1]) compliments the existing shortcut Ctrl+F (Search in current location).

The use case for this is pretty simple (and motivated by me teaching dance classes) and probably pretty common elsewhere, too:

After digging around in my playlists & crates, leaving the computer to teach, and then coming back to it, I want to be able to quickly search for a specific song without having to first pick up the mouse or fiddle around with the trackpad.

[^1]: Ok, it is only "globally" as long as all tracks are present in the main Mixxx database, and not contained in external libraries like iTunes or Rekordbox.[^2]

[^2]: As a later improvement, one could extend Ctrl+Shift+F to, either: a. Actually initiate a global search over all available libraries, or: b. Make default library to which Ctrl+Shift+F jumps configurable in the preferences, or: c. Provide different shortcuts for the different external libraries.

ronso0 commented 2 months ago

Note that there is already Library::searchTracksInCollection (emitted when clicking actions in WSearchRelatedTracksMenu), which (IMHO) allows a much simpler implementation.

cr7pt0gr4ph7 commented 2 months ago

@ronso0 Thanks, I will have a look! I'll have to place the shortcut handling somewehere else, though, so it also works when the search widget is disabled (this behavioris inherent to QShortcut). I'd use a custom key binding in KeyboardEventFilter, but then it'd only work when Keyboard shortcuts are enabled.

Sidenote: There seem to be at at least three ways to define keyboard shortcut actions and associated key sequences right now:

  1. via eventFilter/keyPressEvent
  2. via QShortcut/QAction
  3. via KeyboardEventFilter/*.kbd.cfg/ControlObject (only active wjen

Option 3 is only active when keyboard shortcuts are enabled in the options, but when it is, it (mostly) overrides the other two. Option 2 is somewhat integrated with option 3, but it's all bit convoluted.

Maybe it makes sense to integrate the "(Custom) keyboard shortcuts disabled" codepath into KeyboardEventFilter, too?

ronso0 commented 1 month ago

How about adding "Search in Tracks" to the Library menu? And add the shortcut hint to the searchbar tooltip?