mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-28 14:18:41 +02:00
Fix Shift+M shortcut
Related to an old bug/workaround where I couldn't figure out the reason it act as it did on Winodw. Finally figured out it was the KEY_UP event passing the "M" on to the menu, thus selecting the Mono item.
This commit is contained in:
parent
442c39d46f
commit
e4bb5082bc
@ -1193,7 +1193,8 @@ void AudacityProject::CreateMenusAndCommands()
|
|||||||
c->AddCommand(wxT("TrackGain"), _("Change gain on focused track"), FN(OnTrackGain), wxT("Shift+G"));
|
c->AddCommand(wxT("TrackGain"), _("Change gain on focused track"), FN(OnTrackGain), wxT("Shift+G"));
|
||||||
c->AddCommand(wxT("TrackGainInc"), _("Increase gain on focused track"), FN(OnTrackGainInc), wxT("Alt+Shift+Up"));
|
c->AddCommand(wxT("TrackGainInc"), _("Increase gain on focused track"), FN(OnTrackGainInc), wxT("Alt+Shift+Up"));
|
||||||
c->AddCommand(wxT("TrackGainDec"), _("Decrease gain on focused track"), FN(OnTrackGainDec), wxT("Alt+Shift+Down"));
|
c->AddCommand(wxT("TrackGainDec"), _("Decrease gain on focused track"), FN(OnTrackGainDec), wxT("Alt+Shift+Down"));
|
||||||
c->AddCommand(wxT("TrackMenu"), _("Open menu on focused track"), FN(OnTrackMenu), wxT("Shift+M"));
|
// use "wantevent" to eat the KEY_UP event...fixes a problem on Windows where the key up selects the "Mono" item
|
||||||
|
c->AddCommand(wxT("TrackMenu"), _("Open menu on focused track"), FN(OnTrackMenu), wxT("Shift+M\twantevent"));
|
||||||
c->AddCommand(wxT("TrackMute"), _("Mute/Unmute focused track"), FN(OnTrackMute), wxT("Shift+U"));
|
c->AddCommand(wxT("TrackMute"), _("Mute/Unmute focused track"), FN(OnTrackMute), wxT("Shift+U"));
|
||||||
c->AddCommand(wxT("TrackSolo"), _("Solo/Unsolo focused track"), FN(OnTrackSolo), wxT("Shift+S"));
|
c->AddCommand(wxT("TrackSolo"), _("Solo/Unsolo focused track"), FN(OnTrackSolo), wxT("Shift+S"));
|
||||||
c->AddCommand(wxT("TrackClose"), _("Close focused track"), FN(OnTrackClose), wxT("Shift+C"));
|
c->AddCommand(wxT("TrackClose"), _("Close focused track"), FN(OnTrackClose), wxT("Shift+C"));
|
||||||
@ -2871,31 +2872,7 @@ void AudacityProject::OnTrackGainDec()
|
|||||||
|
|
||||||
void AudacityProject::OnTrackMenu()
|
void AudacityProject::OnTrackMenu()
|
||||||
{
|
{
|
||||||
// LLL: There's a slight problem on Windows that I was not able to track
|
mTrackPanel->OnTrackMenu();
|
||||||
// down to the actual cause. I "think" it might be a problem in wxWidgets
|
|
||||||
// on Windows, but I'm not sure.
|
|
||||||
//
|
|
||||||
// Let's say the user has SHIFT+M assigned as the keyboard shortcut for
|
|
||||||
// bringing up the track menu. If there is only 1 wave track and the user
|
|
||||||
// uses the shortcut, the menu is display and immediately disappears. But,
|
|
||||||
// if there are 2 or more wave tracks, then the menu is displayed.
|
|
||||||
//
|
|
||||||
// However, what is actually happening is that the popup menu is processing
|
|
||||||
// the "M" as the menu item to select after the menu is displayed. With only
|
|
||||||
// 1 track, the only (enabled) menu item that begins with "M" is Mono and
|
|
||||||
// that's what gets selected.
|
|
||||||
//
|
|
||||||
// With 2+ wave tracks, there's 2 menu items that begin with "M" and Mono
|
|
||||||
// is only highlighted by not selected, so the menu doesn't get dismissed.
|
|
||||||
//
|
|
||||||
// While the 1 or 2 track example above is a way to recreate the issue, the
|
|
||||||
// real problem is when there's only one enabled menu item that begins with
|
|
||||||
// the selected shortcut key.
|
|
||||||
//
|
|
||||||
// The workaround is to queue a context menu event, allowing the key press
|
|
||||||
// event to complete.
|
|
||||||
wxContextMenuEvent e(wxEVT_CONTEXT_MENU, GetId());
|
|
||||||
mTrackPanel->GetEventHandler()->AddPendingEvent(e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudacityProject::OnTrackMute()
|
void AudacityProject::OnTrackMute()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user