mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Add player mouse index handling to winraw input driver
This commit is contained in:
parent
44930716ba
commit
39108f97e9
@ -15,6 +15,7 @@
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
#include "../configuration.h"
|
||||
#include "../input_driver.h"
|
||||
#include "../input_keymaps.h"
|
||||
#include "../video_driver.h"
|
||||
@ -230,8 +231,28 @@ static bool winraw_set_mouse_input(HWND window, bool grab)
|
||||
return true;
|
||||
}
|
||||
|
||||
static int16_t winraw_mouse_state(winraw_mouse_t *mouse, bool abs, unsigned id)
|
||||
static int16_t winraw_mouse_state(winraw_input_t *wr,
|
||||
unsigned port, bool abs, unsigned id)
|
||||
{
|
||||
unsigned i;
|
||||
settings_t *settings = config_get_ptr();
|
||||
winraw_mouse_t *mouse = NULL;
|
||||
|
||||
if (port >= MAX_USERS)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < g_mouse_cnt; ++i)
|
||||
{
|
||||
if (i == settings->uints.input_mouse_index[port])
|
||||
{
|
||||
mouse = &wr->mice[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!mouse)
|
||||
return 0;
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case RETRO_DEVICE_ID_MOUSE_X:
|
||||
@ -491,13 +512,9 @@ static int16_t winraw_input_state(void *d,
|
||||
}
|
||||
break;
|
||||
case RETRO_DEVICE_MOUSE:
|
||||
if (port < g_mouse_cnt)
|
||||
return winraw_mouse_state(&wr->mice[port], false, id);
|
||||
break;
|
||||
return winraw_mouse_state(wr, port, false, id);
|
||||
case RARCH_DEVICE_MOUSE_SCREEN:
|
||||
if (port < g_mouse_cnt)
|
||||
return winraw_mouse_state(&wr->mice[port], true, id);
|
||||
break;
|
||||
return winraw_mouse_state(wr, port, true, id);
|
||||
case RETRO_DEVICE_JOYPAD:
|
||||
return winraw_joypad_state(wr, joypad_info, binds[port], port, id);
|
||||
case RETRO_DEVICE_ANALOG:
|
||||
|
Loading…
x
Reference in New Issue
Block a user