muffin v7.4.10
This commit is contained in:
parent
2df81c5d15
commit
b8dd142c23
47 changed files with 3604 additions and 1058 deletions
|
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
|
||||
|
||||
namespace Questionable.Controller.Utils;
|
||||
|
||||
internal static class WindowsKeypress
|
||||
{
|
||||
public enum LimitedKeys
|
||||
{
|
||||
A = 65,
|
||||
Escape = 27
|
||||
}
|
||||
|
||||
private static class NativeMethods
|
||||
{
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
||||
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
|
||||
public static extern nint SendMessage(nint hWnd, uint Msg, nint wParam, nint lParam);
|
||||
}
|
||||
|
||||
public const uint WM_KEYUP = 257u;
|
||||
|
||||
public const uint WM_KEYDOWN = 256u;
|
||||
|
||||
public unsafe static void SendKeypress(LimitedKeys key)
|
||||
{
|
||||
void* hWnd = Device.Instance()->hWnd;
|
||||
NativeMethods.SendMessage((nint)hWnd, 256u, (nint)key, IntPtr.Zero);
|
||||
NativeMethods.SendMessage((nint)hWnd, 257u, (nint)key, IntPtr.Zero);
|
||||
}
|
||||
|
||||
public static void SendMessage(nint hWnd, uint msg, nint key)
|
||||
{
|
||||
NativeMethods.SendMessage(hWnd, msg, key, IntPtr.Zero);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue