From 8535e766c8cb6ec241791bb148585875ff65f1c4 Mon Sep 17 00:00:00 2001 From: Zoran Vuckovic Date: Sat, 20 May 2017 09:13:00 +0200 Subject: [PATCH] Alow raw input driver to be used with GDI --- gfx/drivers_context/gdi_ctx.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/gfx/drivers_context/gdi_ctx.cpp b/gfx/drivers_context/gdi_ctx.cpp index 5ced3e5c07..0266ecd1e0 100644 --- a/gfx/drivers_context/gdi_ctx.cpp +++ b/gfx/drivers_context/gdi_ctx.cpp @@ -28,6 +28,8 @@ #include #include +#include + #ifdef HAVE_CONFIG_H #include "../../config.h" #endif @@ -217,11 +219,22 @@ static void gfx_ctx_gdi_input_driver(void *data, const input_driver_t **input, void **input_data) { (void)data; + settings_t *settings = config_get_ptr(); - dinput_gdi = input_dinput.init(joypad_name); + if (string_is_equal_fast(settings->arrays.input_driver, "raw", 4)) + { + *input_data = input_winraw.init(joypad_name); + if (*input_data) + { + *input = &input_winraw; + dinput_gdi = NULL; + return; + } + } - *input = dinput_gdi ? &input_dinput : NULL; - *input_data = dinput_gdi; + dinput_gdi = input_dinput.init(joypad_name); + *input = dinput_gdi ? &input_dinput : NULL; + *input_data = dinput_gdi; } static bool gfx_ctx_gdi_has_focus(void *data)