Files
Wino-Mail/Wino.Shared.WinRT/Services/KeyPressService.cs

26 lines
581 B
C#
Raw Normal View History


using Windows.System;
2024-04-18 01:44:37 +02:00
using Windows.UI.Core;
using Wino.Domain.Interfaces;
2024-04-18 01:44:37 +02:00
#if NET8_0
using Microsoft.UI.Xaml;
#else
2024-07-20 23:32:39 +02:00
using Microsoft.UI.Xaml;
#endif
namespace Wino.Shared.WinRT.Services
2024-04-18 01:44:37 +02:00
{
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;
}
}