Files
Wino-Mail/Wino.Core.UWP/Services/KeyPressService.cs
2024-07-20 23:32:39 +02:00

24 lines
580 B
C#

using Windows.System;
using Windows.UI.Core;
using Wino.Core.Domain.Interfaces;
#if NET8_0
using Microsoft.UI.Xaml;
#else
using Microsoft.UI.Xaml;
#endif
namespace Wino.Core.UWP.Services
{
public class KeyPressService : IKeyPressService
{
public bool IsCtrlKeyPressed()
=> Window.Current?.CoreWindow?.GetKeyState(VirtualKey.Control).HasFlag(CoreVirtualKeyStates.Down) ?? false;
public bool IsShiftKeyPressed()
=> Window.Current?.CoreWindow?.GetKeyState(VirtualKey.Shift).HasFlag(CoreVirtualKeyStates.Down) ?? false;
}
}