FakeDeck/FakeeDeck/ButtonType/KeyboardMacro.cs
2024-09-06 16:25:04 +02:00

26 lines
694 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace FakeeDeck.ButtonType
{
internal class KeyboardMacro
{
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
public static extern void keybd_event(uint bVk, uint bScan, uint dwFlags, uint dwExtraInfo);
public static void SendKey(uint Key)
{
System.Threading.Thread.Sleep(60);
keybd_event(Key, 0, 0, 0);
System.Threading.Thread.Sleep(60);
keybd_event(Key, 0, 2, 0);
}
}
}