Files
Wino-Mail/Wino.Core.WinUI/Services/KeyPressService.cs
T

16 lines
500 B
C#
Raw Normal View History

2024-04-18 01:44:37 +02:00
using Windows.System;
using Windows.UI.Core;
2025-09-29 11:16:14 +02:00
using Microsoft.UI.Xaml;
2024-04-18 01:44:37 +02:00
using Wino.Core.Domain.Interfaces;
2025-09-29 11:23:44 +02:00
namespace Wino.Core.WinUI.Services;
2025-02-16 11:54:23 +01:00
public class KeyPressService : IKeyPressService
2024-04-18 01:44:37 +02:00
{
2025-02-16 11:54:23 +01:00
public bool IsCtrlKeyPressed()
=> Window.Current?.CoreWindow?.GetKeyState(VirtualKey.Control).HasFlag(CoreVirtualKeyStates.Down) ?? false;
2024-04-18 01:44:37 +02:00
2025-02-16 11:54:23 +01:00
public bool IsShiftKeyPressed()
=> Window.Current?.CoreWindow?.GetKeyState(VirtualKey.Shift).HasFlag(CoreVirtualKeyStates.Down) ?? false;
2024-04-18 01:44:37 +02:00
}