Commit 3a007a95 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

winebus.sys: Support setting SDL controller mapping through environment variable.

parent 6ce03d93
......@@ -1024,8 +1024,15 @@ static DWORD CALLBACK deviceloop_thread(void *args)
{
HKEY key;
static const WCHAR szPath[] = {'m','a','p',0};
const char *mapping;
if (!RegOpenKeyExW(driver_key, szPath, 0, KEY_QUERY_VALUE, &key))
if ((mapping = getenv("SDL_GAMECONTROLLERCONFIG")))
{
TRACE("Setting environment mapping %s\n", debugstr_a(mapping));
if (pSDL_GameControllerAddMapping(mapping) < 0)
WARN("Failed to add environment mapping %s\n", pSDL_GetError());
}
else if (!RegOpenKeyExW(driver_key, szPath, 0, KEY_QUERY_VALUE, &key))
{
DWORD index = 0;
CHAR *buffer = NULL;
......@@ -1054,8 +1061,9 @@ static DWORD CALLBACK deviceloop_thread(void *args)
if (rc == STATUS_SUCCESS)
{
TRACE("Setting mapping %s...\n",debugstr_an(buffer,29));
pSDL_GameControllerAddMapping(buffer);
TRACE("Setting registry mapping %s\n", debugstr_a(buffer));
if (pSDL_GameControllerAddMapping(buffer) < 0)
WARN("Failed to add registry mapping %s\n", pSDL_GetError());
index ++;
}
} while (rc == STATUS_SUCCESS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment