Added SinaglR

This commit is contained in:
2023-06-08 13:36:25 -07:00
parent 2c38ecb399
commit 9452454b8a
33 changed files with 3540 additions and 33 deletions

View File

@ -115,9 +115,10 @@ public class InputReader : IDisposable
{
short code = GetCode();
int value = GetValue();
DateTime dateTime = DateTime.Now;
KeyState keyState = (KeyState)value;
EventCode eventCode = (EventCode)code;
KeyPressEvent keyPressEvent = new(eventCode, keyState, new TimeSpan(DateTime.Now.Ticks - _Ticks));
KeyPressEvent keyPressEvent = new(dateTime, eventCode, keyState, new TimeSpan(dateTime.Ticks - _Ticks));
OnKeyPress?.Invoke(keyPressEvent);
}

View File

@ -2,13 +2,14 @@ namespace Barcode.Host.Shared.KeyboardMouse;
public readonly struct KeyPressEvent
{
public DateTime DateTime { get; init; }
public EventCode EventCode { get; init; }
public KeyState KeyState { get; init; }
public TimeSpan TimeSpan { get; init; }
public KeyPressEvent(EventCode eventCode, KeyState keyState, TimeSpan timeSpan)
public KeyPressEvent(DateTime dateTime, EventCode eventCode, KeyState keyState, TimeSpan timeSpan)
{
DateTime = dateTime;
EventCode = eventCode;
KeyState = keyState;
TimeSpan = timeSpan;