- build-macos.sh: cross-compiles the Windows x64 client on Apple Silicon (LLVM clang-cl/lld-link + xwin Windows SDK, fxc via Wine with native d3dcompiler DLLs) - run-client.sh: dedicated Wine prefix with DXVK-macOS (D3D11->Vulkan) on MoltenVK (Vulkan->Metal) - tools/: in-Wine input injectors for automated verification
42 lines
981 B
C
42 lines
981 B
C
// send_key.exe <hexVk> [hexVk...] — focuses the Minecraft window and sends key taps.
|
|
#include <windows.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
static BOOL CALLBACK enumProc(HWND hwnd, LPARAM lParam)
|
|
{
|
|
if (!IsWindowVisible(hwnd))
|
|
return TRUE;
|
|
wchar_t title[256] = {0};
|
|
GetWindowTextW(hwnd, title, 255);
|
|
if (wcsstr(title, L"Minecraft"))
|
|
{
|
|
*(HWND *)lParam = hwnd;
|
|
return FALSE;
|
|
}
|
|
return TRUE;
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
HWND target = NULL;
|
|
EnumWindows(enumProc, (LPARAM)&target);
|
|
if (!target)
|
|
{
|
|
printf("no Minecraft window found\n");
|
|
return 1;
|
|
}
|
|
SetForegroundWindow(target);
|
|
Sleep(400);
|
|
for (int i = 1; i < argc; i++)
|
|
{
|
|
int vk = (int)strtol(argv[i], NULL, 16);
|
|
keybd_event((BYTE)vk, 0, 0, 0);
|
|
Sleep(80);
|
|
keybd_event((BYTE)vk, 0, KEYEVENTF_KEYUP, 0);
|
|
Sleep(400);
|
|
printf("sent vk 0x%02X\n", vk);
|
|
}
|
|
return 0;
|
|
}
|