mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
[QuickAccent] Shift + Space to navigate backwards (#21817)
* shift space to navigate backwards * detect shift with visible toolbar * distinguish left/right shift * fix
This commit is contained in:
committed by
GitHub
parent
5779b43c80
commit
8fb93dc6ee
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
@@ -52,11 +52,11 @@ public class PowerAccent : IDisposable
|
||||
});
|
||||
}));
|
||||
|
||||
_keyboardListener.SetNextCharEvent(new PowerToys.PowerAccentKeyboardService.NextChar((TriggerKey triggerKey) =>
|
||||
_keyboardListener.SetNextCharEvent(new PowerToys.PowerAccentKeyboardService.NextChar((TriggerKey triggerKey, bool shiftPressed) =>
|
||||
{
|
||||
System.Windows.Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
ProcessNextChar(triggerKey);
|
||||
ProcessNextChar(triggerKey, shiftPressed);
|
||||
});
|
||||
}));
|
||||
|
||||
@@ -106,7 +106,7 @@ public class PowerAccent : IDisposable
|
||||
_visible = false;
|
||||
}
|
||||
|
||||
private void ProcessNextChar(TriggerKey triggerKey)
|
||||
private void ProcessNextChar(TriggerKey triggerKey, bool shiftPressed)
|
||||
{
|
||||
if (_visible && _selectedIndex == -1)
|
||||
{
|
||||
@@ -141,13 +141,27 @@ public class PowerAccent : IDisposable
|
||||
|
||||
if (triggerKey == TriggerKey.Space)
|
||||
{
|
||||
if (_selectedIndex < _characters.Length - 1)
|
||||
if (shiftPressed)
|
||||
{
|
||||
++_selectedIndex;
|
||||
if (_selectedIndex == 0)
|
||||
{
|
||||
_selectedIndex = _characters.Length - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
--_selectedIndex;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_selectedIndex = 0;
|
||||
if (_selectedIndex < _characters.Length - 1)
|
||||
{
|
||||
++_selectedIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
_selectedIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user