Add filter capacity in Shortcut mapper by shortcut key combination
This allows to filter shortcuts in Shortcut mapper not only by name but also by key combination text. Fix #5616, fix #9316, close #10192pull/10234/head
parent
50dfdb2a8d
commit
3482673fd8
|
@ -141,18 +141,15 @@ generic_string ShortcutMapper::getTextFromCombo(HWND hCombo)
|
|||
|
||||
bool ShortcutMapper::isFilterValid(Shortcut sc)
|
||||
{
|
||||
bool match = false;
|
||||
generic_string shortcut_name = stringToLower(generic_string(sc.getName()));
|
||||
if (_shortcutFilter.empty())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// test the filter on the shortcut name
|
||||
size_t match_pos = shortcut_name.find(_shortcutFilter);
|
||||
if (match_pos != std::string::npos){
|
||||
match = true;
|
||||
}
|
||||
return match;
|
||||
|
||||
generic_string shortcut_name = stringToLower(generic_string(sc.getName()));
|
||||
generic_string shortcut_value = stringToLower(sc.toString());
|
||||
|
||||
// test the filter on the shortcut name and value
|
||||
return (shortcut_name.find(_shortcutFilter) != std::string::npos) ||
|
||||
(shortcut_value.find(_shortcutFilter) != std::string::npos);
|
||||
}
|
||||
|
||||
bool ShortcutMapper::isFilterValid(PluginCmdShortcut sc)
|
||||
|
|
Loading…
Reference in New Issue