1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-13 08:06:32 +01:00

easy change key bindings

This commit is contained in:
Paul Licameli
2017-08-29 10:02:22 -04:00
parent 1f7b62f056
commit aa5c3f12a3
6 changed files with 41 additions and 9 deletions

View File

@@ -1479,9 +1479,25 @@ bool CommandManager::HandleCommandEntry(const CommandListEntry * entry,
///CommandManagerListener function. If you pass any flags,
///the command won't be executed unless the flags are compatible
///with the command's flags.
#include "../prefs/PrefsDialog.h"
#include "../prefs/KeyConfigPrefs.h"
bool CommandManager::HandleMenuID(int id, CommandFlag flags, CommandMask mask)
{
CommandListEntry *entry = mCommandIDHash[id];
#ifdef EXPERIMENTAL_EASY_CHANGE_KEY_BINDINGS
if (::wxGetMouseState().ShiftDown()) {
// Only want one page of the preferences
KeyConfigPrefsFactory keyConfigPrefsFactory{ entry->name };
PrefsDialog::Factories factories;
factories.push_back(&keyConfigPrefsFactory);
GlobalPrefsDialog dialog(GetActiveProject(), factories);
dialog.ShowModal();
AudacityProject::RebuildAllMenuBars();
return true;
}
#endif
return HandleCommandEntry( entry, flags, mask );
}