Sicherung

This commit is contained in:
Maier Stephan SI
2023-04-17 07:07:49 +02:00
parent f3f89b94f5
commit 1c68b8f401
1307 changed files with 7918 additions and 82491 deletions

View File

@@ -0,0 +1,56 @@
// <copyright file="KeyboardInput.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using FSI.BT.Tools.TimeStampToClipboard.Helper;
using System;
namespace FSI.BT.Tools.TimeStampToClipboard.Handler
{
internal class KeyboardInput : IDisposable
{
private readonly KeyboardHook hook = new();
private int iRowKey = -1;
private int iMenuKey;
public KeyboardInput()
{
}
public event Action HotKeyPressed;
public void Dispose()
{
hook.KeyPressed -= Hook_KeyPressed;
hook.Dispose();
}
public void RegisterHotKey()
{
if (!string.IsNullOrEmpty(Global.Vars.TimeStampSettings.HotKey))
{
try
{
hook.RegisterHotKey();
hook.KeyPressed += Hook_KeyPressed;
}
catch (InvalidOperationException ex)
{
//Log.Warn($"key:'{Properties.Settings.Default.HotKey}'", ex);
Global.Vars.TimeStampSettings.HotKey = string.Empty;
//Properties.Settings.Default.Save();
}
}
}
private void Hook_KeyPressed(object sender, FSI.BT.Tools.TimeStampToClipboard.Helper.KeyPressedEventArgs e)
{
HotKeyPressed?.Invoke();
}
}
}