/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/launcher/PowerLauncher/Helper/KeyboardHelper.cs
43 строки
1 KB
Jeremy Sinclair
[Analyzers] Resolve StyleCop issues: SA1516 and SA1616 (#34853)
16 сен 2024, 23:09
Не верифицирован
16 сен 2024, 23:09
37f2154
Код
Авторство
О чём код?
// 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. using System.Windows.Input; using Wox.Plugin; namespace PowerLauncher.Helper { internal sealed class KeyboardHelper { public static SpecialKeyState CheckModifiers() { SpecialKeyState state = new SpecialKeyState(); if ((Keyboard.GetKeyStates(Key.LeftShift) & KeyStates.Down) > 0 || (Keyboard.GetKeyStates(Key.RightShift) & KeyStates.Down) > 0) { state.ShiftPressed = true; } if ((Keyboard.GetKeyStates(Key.LWin) & KeyStates.Down) > 0 || (Keyboard.GetKeyStates(Key.RWin) & KeyStates.Down) > 0) { state.WinPressed = true; } if ((Keyboard.GetKeyStates(Key.LeftCtrl) & KeyStates.Down) > 0 || (Keyboard.GetKeyStates(Key.RightCtrl) & KeyStates.Down) > 0) { state.CtrlPressed = true; } if ((Keyboard.GetKeyStates(Key.LeftAlt) & KeyStates.Down) > 0 || (Keyboard.GetKeyStates(Key.RightAlt) & KeyStates.Down) > 0) { state.AltPressed = true; } return state; } } }