Added SinaglR
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
5
Shared/Models/Notification.cs
Normal file
5
Shared/Models/Notification.cs
Normal file
@ -0,0 +1,5 @@
|
||||
using Barcode.Host.Shared.KeyboardMouse;
|
||||
|
||||
namespace Barcode.Host.Shared.Models;
|
||||
|
||||
public record Notification(KeyPressEvent KeyPressEvent, string LastScanServiceResultValue);
|
Reference in New Issue
Block a user