mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-07-03 05:21:09 +12:00
Repeating a character in search will jump to next element starting with this character only at the beginning of the search
Means repeating a character in the middle of a search the character will be appended to the search string instead of jumping to next element (as this would prevent searching for any item which has same characters twice next to each other) Fixes #30 https://github.com/Hofknecht/SystemTrayMenu/issues/30
This commit is contained in:
parent
04396f7134
commit
381dc3c8a0
|
@ -780,14 +780,13 @@ namespace SystemTrayMenu
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(KeySearchString))
|
if (string.IsNullOrEmpty(KeySearchString))
|
||||||
{
|
{
|
||||||
// no search string set, start new search
|
// no search string set, start new search with initial letter
|
||||||
KeySearchString += letter;
|
KeySearchString += letter;
|
||||||
SelectByKey(Keys.None, KeySearchString);
|
SelectByKey(Keys.None, KeySearchString);
|
||||||
}
|
}
|
||||||
else if (KeySearchString.LastOrDefault().ToString() == letter)
|
else if (KeySearchString.Length == 1 && KeySearchString.LastOrDefault().ToString() == letter)
|
||||||
{
|
{
|
||||||
// previous letter pressed again, jump to next element
|
// initial letter pressed again, jump to next element
|
||||||
KeySearchString += letter;
|
|
||||||
SelectByKey(Keys.None, letter);
|
SelectByKey(Keys.None, letter);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue