1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-31 16:09:28 +02:00

Bug 1641 - Panel navigation accelerators don't appear in the menus

This attempted fix applies the 'space' trick to make accelerators invalid, so "Left" is added as " Left" into the menus, and appears normal but does not act as an accelerator.  This is now only done for the problematic accelerators rather than for all accelerators.  It's believed that doing it for all accelerators caused the problem.

In debug builds users will see messages like the one below in the console:

"Unrecognized accel key ' right', accel string ignored."

This fix additionally adds 0..9 to the specially handled accelerators.  This should address:
Bug 1260 - Cant type "1" in the Project Rate text box

The fix has been developed and tested on Window only.  Theoretically the space might cause problems on Mac and if it does the 'space' trick could be applied just on Windows and Linux, since Mac did not seem to have the problem reported in 1260.
This commit is contained in:
James Crook 2017-05-07 10:59:50 +01:00
parent 6491aed13c
commit 6e65596b47

View File

@ -975,9 +975,13 @@ wxString CommandManager::GetLabelWithDisabledAccel(const CommandListEntry *entry
{
wxString label = entry->label;
#if 1
wxString Accel = "";
do{
if (!entry->key.IsEmpty())
{
// Dummy accelerator that looks Ok in menus but is non functional.
// Note the space before the key.
Accel = wxString("\t ") + entry->key;
if( entry->key.StartsWith("Left" )) break;
if( entry->key.StartsWith("Right")) break;
if( entry->key.StartsWith("Up" )) break;
@ -985,15 +989,29 @@ wxString CommandManager::GetLabelWithDisabledAccel(const CommandListEntry *entry
if( entry->key.StartsWith("Return")) break;
if( entry->key.StartsWith("Tab")) break;
if( entry->key.StartsWith("Shift+Tab")) break;
if( entry->key.StartsWith("0")) break;
if( entry->key.StartsWith("1")) break;
if( entry->key.StartsWith("2")) break;
if( entry->key.StartsWith("3")) break;
if( entry->key.StartsWith("4")) break;
if( entry->key.StartsWith("5")) break;
if( entry->key.StartsWith("6")) break;
if( entry->key.StartsWith("7")) break;
if( entry->key.StartsWith("8")) break;
if( entry->key.StartsWith("9")) break;
// No accelerator.
Accel = "";
//if( entry->key.StartsWith("Space" )) break;
// These ones appear ot be illegal and mess up accelerator processing.
// These ones appear to be illegal and mess up accelerator processing.
if( entry->key.StartsWith("NUMPAD_ENTER" )) break;
if( entry->key.StartsWith("Backspace" )) break;
if( entry->key.StartsWith("Delete" )) break;
label += wxT("\t") + entry->key;
//wxLogDebug("Added Accel:[%s][%s]", entry->label, entry->key );
// Normal accelerator.
Accel = wxString("\t") + entry->key;
}
} while (false );
label += Accel;
#endif
return label;
}
@ -1203,6 +1221,16 @@ bool CommandManager::FilterKeyEvent(AudacityProject *project, const wxKeyEvent &
case WXK_RETURN:
case WXK_NUMPAD_ENTER:
case WXK_DELETE:
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
return false;
}
}