Contextual hotkeys can overlap for different tools

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8512
This commit is contained in:
Jon Evans 2021-05-30 14:12:03 -04:00
parent b7f32d7f53
commit d856b01d32
1 changed files with 9 additions and 0 deletions

View File

@ -223,6 +223,15 @@ bool HOTKEY_STORE::CheckKeyConflicts( TOOL_ACTION* aAction, long aKey, HOTKEY**
if( hotkey.m_EditKeycode == aKey )
{
// We can use the same key for a different action if both actions are contextual and
// for different tools.
if( hotkey.m_Actions[0]->GetScope() == AS_CONTEXT &&
aAction->GetScope() == AS_CONTEXT &&
hotkey.m_Actions[0]->GetToolName() != aAction->GetToolName() )
{
continue;
}
*aConflict = &hotkey;
return true;
}