// compile with: // gcc -o getdxdidf.exe src\getdxdidf.c -Ic:\mingw32\dx6\include -Lc:\mingw32\dx6\lib -ldxguid -ldinput -mwindows #define WIN32_LEAN_AND_MEAN #define INITGUID #define DIRECTINPUT_VERSION 0x0700 #include #include #include #include "compat.h" char *WhatGUID(const GUID *guid) { if (guid == &GUID_XAxis) return "&GUID_XAxis"; if (guid == &GUID_YAxis) return "&GUID_YAxis"; if (guid == &GUID_ZAxis) return "&GUID_ZAxis"; if (guid == &GUID_RxAxis) return "&GUID_RxAxis"; if (guid == &GUID_RyAxis) return "&GUID_RyAxis"; if (guid == &GUID_RzAxis) return "&GUID_RzAxis"; if (guid == &GUID_Slider) return "&GUID_Slider"; if (guid == &GUID_Button) return "&GUID_Button"; if (guid == &GUID_Key) return "&GUID_Key"; if (guid == &GUID_POV) return "&GUID_POV"; if (guid == &GUID_Unknown) return "&GUID_Unknown"; return "NULL"; } int WINAPI WinMain(HINSTANCE hInstance ATTRIBUTE((unused)), HINSTANCE hPrevInstance ATTRIBUTE((unused)), LPSTR lpCmdLine ATTRIBUTE((unused)), int nCmdShow ATTRIBUTE((unused))) { FILE *fp; DWORD i; fp = fopen("didf.txt", "w"); if (!fp) return -1; setvbuf(fp, NULL, _IONBF, 0); fprintf(fp, "// Keyboard\n" "\n" "static DIOBJECTDATAFORMAT c_dfDIKeyboard_odf[] = {\n" ); for (i=0; i