2025-10-27 22:52:26 +01:00
|
|
|
using Microsoft.UI.Input;
|
|
|
|
|
using Windows.System;
|
2024-04-18 01:44:37 +02:00
|
|
|
using Windows.UI.Core;
|
|
|
|
|
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()
|
2025-10-27 22:52:26 +01:00
|
|
|
=> InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Control).HasFlag(CoreVirtualKeyStates.Down);
|
2024-04-18 01:44:37 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public bool IsShiftKeyPressed()
|
2025-10-27 22:52:26 +01:00
|
|
|
=> InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Shift).HasFlag(CoreVirtualKeyStates.Down);
|
2024-04-18 01:44:37 +02:00
|
|
|
}
|