Update set keyboard mapping code for input driver

This commit is contained in:
twinaphex 2019-07-27 02:21:24 +02:00
parent d80dee882f
commit 65b4c2595e
92 changed files with 159 additions and 550 deletions

View File

@ -131,7 +131,8 @@ int32_t d3d_translate_filter(unsigned type)
return (int32_t)D3D_TEXTURE_FILTER_POINT;
}
void d3d_input_driver(const char* input_name, const char* joypad_name, const input_driver_t** input, void** input_data)
void d3d_input_driver(const char* input_name, const char* joypad_name,
input_driver_t** input, void** input_data)
{
#if defined(__WINRT__)
/* Plain xinput is supported on UWP, but it
@ -139,18 +140,18 @@ void d3d_input_driver(const char* input_name, const char* joypad_name, const inp
if (string_is_equal(input_name, "xinput"))
{
void *xinput = input_xinput.init(joypad_name);
*input = xinput ? (const input_driver_t*)&input_xinput : NULL;
*input = xinput ? (input_driver_t*)&input_xinput : NULL;
*input_data = xinput;
}
else
{
void *uwp = input_uwp.init(joypad_name);
*input = uwp ? (const input_driver_t*)&input_uwp : NULL;
*input = uwp ? (input_driver_t*)&input_uwp : NULL;
*input_data = uwp;
}
#elif defined(_XBOX)
void *xinput = input_xinput.init(joypad_name);
*input = xinput ? (const input_driver_t*)&input_xinput : NULL;
*input = xinput ? (input_driver_t*)&input_xinput : NULL;
*input_data = xinput;
#else
#if _WIN32_WINNT >= 0x0501

View File

@ -105,7 +105,7 @@ void *d3d_matrix_rotation_z(void *_pout, float angle);
int32_t d3d_translate_filter(unsigned type);
void d3d_input_driver(const char* input_name,
const char* joypad_name, const input_driver_t** input, void** input_data);
const char* joypad_name, input_driver_t** input, void** input_data);
RETRO_END_DECLS

View File

@ -80,7 +80,7 @@ extern MTLPixelFormat SelectOptimalPixelFormat(MTLPixelFormat fmt);
@property (nonatomic, readonly) Uniforms *viewportMVP;
- (instancetype)initWithVideo:(const video_info_t *)video
input:(const input_driver_t **)input
input:(input_driver_t **)input
inputData:(void **)inputData;
- (void)setVideo:(const video_info_t *)video;

View File

@ -88,7 +88,7 @@
}
- (instancetype)initWithVideo:(const video_info_t *)video
input:(const input_driver_t **)input
input:(input_driver_t **)input
inputData:(void **)inputData
{
if (self = [super init])

View File

@ -66,7 +66,7 @@ static void caca_gfx_create(void)
}
static void *caca_gfx_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
caca_t *caca = (caca_t*)calloc(1, sizeof(*caca));

View File

@ -326,7 +326,7 @@ static void ctr_set_bottom_screen_enable(void* data, bool enabled)
}
static void* ctr_init(const video_info_t* video,
const input_driver_t** input, void** input_data)
input_driver_t** input, void** input_data)
{
float refresh_rate;
u8 device_model = 0xFF;

View File

@ -606,9 +606,8 @@ static void d3d10_gfx_free(void* data)
free(d3d10);
}
static void*
d3d10_gfx_init(const video_info_t* video,
const input_driver_t** input, void** input_data)
static void *d3d10_gfx_init(const video_info_t* video,
input_driver_t** input, void** input_data)
{
unsigned i;
#ifdef HAVE_MONITOR

View File

@ -621,8 +621,8 @@ static void d3d11_gfx_free(void* data)
free(d3d11);
}
static void*
d3d11_gfx_init(const video_info_t* video, const input_driver_t** input, void** input_data)
static void *d3d11_gfx_init(const video_info_t* video,
input_driver_t** input, void** input_data)
{
unsigned i;
#ifdef HAVE_MONITOR

View File

@ -892,8 +892,8 @@ static void d3d12_gfx_free(void* data)
free(d3d12);
}
static void*
d3d12_gfx_init(const video_info_t* video, const input_driver_t** input, void** input_data)
static void *d3d12_gfx_init(const video_info_t* video,
input_driver_t** input, void** input_data)
{
#ifdef HAVE_MONITOR
MONITORINFOEX current_mon;

View File

@ -1126,7 +1126,7 @@ static void d3d8_set_osd_msg(void *data,
}
static bool d3d8_init_internal(d3d8_video_t *d3d,
const video_info_t *info, const input_driver_t **input,
const video_info_t *info, input_driver_t **input,
void **input_data)
{
#ifdef HAVE_MONITOR
@ -1237,7 +1237,7 @@ static void d3d8_show_mouse(void *data, bool state)
}
static void *d3d8_init(const video_info_t *info,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
d3d8_video_t *d3d = (d3d8_video_t*)calloc(1, sizeof(*d3d));

View File

@ -1148,7 +1148,7 @@ static void d3d9_set_osd_msg(void *data,
}
static bool d3d9_init_internal(d3d9_video_t *d3d,
const video_info_t *info, const input_driver_t **input,
const video_info_t *info, input_driver_t **input,
void **input_data)
{
#ifdef HAVE_MONITOR
@ -1291,7 +1291,7 @@ static void d3d9_show_mouse(void *data, bool state)
}
static void *d3d9_init(const video_info_t *info,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
d3d9_video_t *d3d = (d3d9_video_t*)calloc(1, sizeof(*d3d));

View File

@ -383,7 +383,7 @@ static void dispmanx_blank_console (struct dispmanx_video *_dispvars)
}
static void *dispmanx_gfx_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
struct dispmanx_video *_dispvars = calloc(1, sizeof(struct dispmanx_video));

View File

@ -704,7 +704,7 @@ static bool init_drm(void)
}
static void *drm_gfx_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
struct drm_video *_drmvars = (struct drm_video*)
calloc(1, sizeof(struct drm_video));

View File

@ -1164,7 +1164,7 @@ static int exynos_render_msg(struct exynos_video *vid,
}
static void *exynos_gfx_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
struct exynos_video *vid;
const unsigned fb_bpp = 4; /* Use XRGB8888 framebuffer. */

View File

@ -78,7 +78,7 @@ static void gdi_gfx_create(void)
}
static void *gdi_gfx_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
unsigned full_x, full_y;
gfx_ctx_input_t inp;

View File

@ -3636,7 +3636,7 @@ static bool renderchain_gl2_init_first(void **renderchain_handle)
}
static void *gl2_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
enum gfx_wrap_type wrap_type;
gfx_ctx_mode_t mode;

View File

@ -228,7 +228,7 @@ static unsigned get_pot(unsigned x)
}
static void *gl1_gfx_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
unsigned full_x, full_y;
gfx_ctx_input_t inp;

View File

@ -933,7 +933,7 @@ static void gl_core_begin_debug(gl_core_t *gl)
#endif
static void *gl_core_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
gfx_ctx_mode_t mode;
gfx_ctx_input_t inp;

View File

@ -203,7 +203,7 @@ static void wiiu_gfx_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
static uint32_t wiiu_gfx_get_flags(void *data);
static void *wiiu_gfx_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
settings_t *settings = config_get_ptr();
float refresh_rate = 60.0f / 1.001f;

View File

@ -782,7 +782,7 @@ static void gx_efb_screenshot(void)
#endif
static void *gx_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
settings_t *settings = config_get_ptr();
void *gxinput = NULL;

View File

@ -61,9 +61,10 @@ static uint32_t metal_get_flags(void *data);
static bool metal_set_shader(void *data,
enum rarch_shader_type type, const char *path);
static void *metal_init(const video_info_t *video,
const input_driver_t **input,
void **input_data)
static void *metal_init(
const video_info_t *video,
input_driver_t **input,
void **input_data)
{
[apple_platform setViewType:APPLE_VIEW_TYPE_METAL];

View File

@ -19,7 +19,7 @@
#include "../../verbosity.h"
static void *null_gfx_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
RARCH_ERR("Using the null video driver. RetroArch will not be visible.");

View File

@ -930,7 +930,7 @@ static void omap_render_msg(omap_video_t *vid, const char *msg)
/* FIXME/TODO: Filters not supported. */
static void *omap_gfx_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
settings_t *settings = config_get_ptr();
omap_video_t *vid = (omap_video_t*)calloc(1, sizeof(omap_video_t));

View File

@ -222,7 +222,7 @@ static void ps2_texture_upload(GSGLOBAL *gsGlobal, GSTEXTURE *Texture, bool send
}
static void *ps2_gfx_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
void *ps2input = NULL;
*input_data = NULL;

View File

@ -259,7 +259,7 @@ static void psp_on_vblank(u32 sub, psp1_video_t *psp)
}
static void *psp_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
/* TODO : add ASSERT() checks or use main RAM if
* VRAM is too low for desired video->input_scale. */

View File

@ -375,7 +375,7 @@ static void sdl_refresh_input_size(sdl2_video_t *vid, bool menu, bool rgb32,
}
static void *sdl2_gfx_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
int i;
unsigned flags;

View File

@ -227,7 +227,8 @@ static void sdl_gfx_set_handles(void)
#endif
}
static void *sdl_gfx_init(const video_info_t *video, const input_driver_t **input, void **input_data)
static void *sdl_gfx_init(const video_info_t *video,
input_driver_t **input, void **input_data)
{
unsigned full_x, full_y;
const SDL_VideoInfo *video_info = NULL;

View File

@ -187,7 +187,7 @@ static void scroll_on_demand(int pixelheight)
}
static void *sixel_gfx_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
gfx_ctx_input_t inp;
void *ctx_data = NULL;

View File

@ -619,7 +619,7 @@ static void sunxi_vsync_thread_func(void *data)
}
static void *sunxi_gfx_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
struct sunxi_video *_dispvars = (struct sunxi_video*)
calloc(1, sizeof(struct sunxi_video));

View File

@ -81,7 +81,7 @@ typedef struct
} switch_video_t;
static void *switch_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
unsigned x, y;
switch_video_t *sw = (switch_video_t*)calloc(1, sizeof(*sw));

View File

@ -174,7 +174,7 @@ static void clear_screen(switch_video_t *sw)
}
static void *switch_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
void *switchinput = NULL;
switch_video_t *sw = (switch_video_t *)calloc(1, sizeof(*sw));

View File

@ -94,7 +94,7 @@ static INLINE bool vg_query_extension(const char *ext)
}
static void *vg_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
gfx_ctx_mode_t mode;
gfx_ctx_input_t inp;

View File

@ -110,7 +110,7 @@ static void vga_gfx_create(void)
}
static void *vga_gfx_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
vga_t *vga = (vga_t*)calloc(1, sizeof(*vga));

View File

@ -44,7 +44,7 @@ static void vita2d_gfx_set_viewport(void *data, unsigned viewport_width,
unsigned viewport_height, bool force_full, bool allow_rotate);
static void *vita2d_gfx_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
vita_video_t *vita = (vita_video_t *)calloc(1, sizeof(vita_video_t));
unsigned temp_width = PSP_FB_WIDTH;

View File

@ -1153,7 +1153,7 @@ static void vulkan_init_readback(vk_t *vk)
}
static void *vulkan_init(const video_info_t *video,
const input_driver_t **input,
input_driver_t **input,
void **input_data)
{
gfx_ctx_mode_t mode;

View File

@ -103,7 +103,8 @@ static void xenon360_gfx_free(void *data)
free(vid);
}
static void *xenon360_gfx_init(const video_info_t *video, const input_driver_t **input, void **input_data)
static void *xenon360_gfx_init(const video_info_t *video,
input_driver_t **input, void **input_data)
{
gl_t * gl = calloc(1, sizeof(gl_t));
if (!gl)

View File

@ -50,7 +50,7 @@ typedef struct xshm
} xshm_t;
static void *xshm_gfx_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
xshm_t* xshm = (xshm_t*)malloc(sizeof(xshm_t));
Window parent;

View File

@ -420,7 +420,7 @@ static void xv_calc_out_rect(bool keep_aspect,
}
static void *xv_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
unsigned i;
int ret;

View File

@ -363,7 +363,7 @@ static bool android_gfx_ctx_set_video_mode(void *data,
static void android_gfx_ctx_input_driver(void *data,
const char *joypad_name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
void *androidinput = input_android.init(joypad_name);

View File

@ -136,7 +136,7 @@ static void gfx_ctx_cgl_destroy(void *data)
static void gfx_ctx_cgl_input_driver(void *data,
const char *name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
(void)data;
(void)input;

View File

@ -456,7 +456,7 @@ static bool cocoagl_gfx_ctx_suppress_screensaver(void *data, bool enable)
static void cocoagl_gfx_ctx_input_driver(void *data,
const char *name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
*input = NULL;
*input_data = NULL;

View File

@ -757,7 +757,7 @@ static void gfx_ctx_drm_destroy(void *data)
static void gfx_ctx_drm_input_driver(void *data,
const char *joypad_name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
#ifdef HAVE_X11
settings_t *settings = config_get_ptr();

View File

@ -283,7 +283,7 @@ static bool gfx_ctx_emscripten_bind_api(void *data,
static void gfx_ctx_emscripten_input_driver(void *data,
const char *name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
void *rwebinput = input_rwebinput.init(name);

View File

@ -250,7 +250,7 @@ error:
static void gfx_ctx_gdi_input_driver(void *data,
const char *joypad_name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
#if _WIN32_WINNT >= 0x0501
settings_t *settings = config_get_ptr();

View File

@ -66,7 +66,7 @@ static void gfx_ctx_null_destroy(void *data)
static void gfx_ctx_null_input_driver(void *data,
const char *name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
(void)data;
(void)input;

View File

@ -157,7 +157,7 @@ error:
static void gfx_ctx_khr_display_input_driver(void *data,
const char *joypad_name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
#ifdef HAVE_X11
settings_t *settings = config_get_ptr();

View File

@ -213,7 +213,7 @@ error:
static void gfx_ctx_mali_fbdev_input_driver(void *data,
const char *name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
*input = NULL;
*input_data = NULL;

View File

@ -180,7 +180,7 @@ error:
static void gfx_ctx_opendingux_input_driver(void *data,
const char *name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
*input = NULL;
*input_data = NULL;

View File

@ -184,10 +184,10 @@ error:
}
static void orbis_ctx_input_driver(void *data,
const char *name,
const input_driver_t **input, void **input_data)
const char *name,
input_driver_t **input, void **input_data)
{
*input = NULL;
*input = NULL;
*input_data = NULL;
}

View File

@ -353,7 +353,7 @@ static void osmesa_ctx_swap_buffers(void *data, void *data2)
static void osmesa_ctx_input_driver(void *data,
const char *name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
*input = NULL;
*input_data = NULL;

View File

@ -315,7 +315,7 @@ static void gfx_ctx_ps3_destroy(void *data)
static void gfx_ctx_ps3_input_driver(void *data,
const char *joypad_name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
void *ps3input = input_ps3.init(joypad_name);

View File

@ -322,7 +322,7 @@ static bool gfx_ctx_qnx_set_video_mode(void *data,
static void gfx_ctx_qnx_input_driver(void *data,
const char *joypad_name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
void *qnxinput = input_qnx.init(joypad_name);

View File

@ -379,7 +379,7 @@ static void sdl_ctx_swap_buffers(void *data, void *data2)
static void sdl_ctx_input_driver(void *data,
const char *name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
*input = NULL;
*input_data = NULL;

View File

@ -108,7 +108,7 @@ static bool gfx_ctx_sixel_set_video_mode(void *data,
static void gfx_ctx_sixel_input_driver(void *data,
const char *joypad_name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
(void)data;

View File

@ -194,10 +194,10 @@ error:
}
static void switch_ctx_input_driver(void *data,
const char *name,
const input_driver_t **input, void **input_data)
const char *name,
input_driver_t **input, void **input_data)
{
*input = NULL;
*input = NULL;
*input_data = NULL;
}

View File

@ -488,7 +488,7 @@ static void gfx_ctx_vc_destroy(void *data)
static void gfx_ctx_vc_input_driver(void *data,
const char *name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
*input = NULL;
*input_data = NULL;

View File

@ -187,7 +187,7 @@ error:
static void gfx_ctx_vivante_input_driver(void *data,
const char *name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
*input = NULL;
*input_data = NULL;

View File

@ -1769,14 +1769,14 @@ bool input_wl_init(void *data, const char *joypad_name);
static void gfx_ctx_wl_input_driver(void *data,
const char *joypad_name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data;
/* Input is heavily tied to the window stuff
* on Wayland, so just implement the input driver here. */
if (!input_wl_init(&wl->input, joypad_name))
{
*input = NULL;
*input = NULL;
*input_data = NULL;
}
else

View File

@ -689,7 +689,7 @@ error:
static void gfx_ctx_wgl_input_driver(void *data,
const char *joypad_name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
settings_t *settings = config_get_ptr();

View File

@ -994,7 +994,7 @@ error:
static void gfx_ctx_x_input_driver(void *data,
const char *joypad_name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
void *x_input = NULL;
#ifdef HAVE_UDEV

View File

@ -456,7 +456,7 @@ error:
static void gfx_ctx_xegl_input_driver(void *data,
const char *joypad_name,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
void *xinput = input_x.init(joypad_name);

View File

@ -161,7 +161,7 @@ struct thread_video
const video_poke_interface_t *poke;
void *driver_data;
const input_driver_t **input;
input_driver_t **input;
void **input_data;
struct
@ -220,7 +220,7 @@ struct thread_video
};
static void *video_thread_init_never_call(const video_info_t *video,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
(void)video;
(void)input;
@ -793,7 +793,7 @@ static void video_thread_set_nonblock_state(void *data, bool state)
static bool video_thread_init(thread_video_t *thr,
const video_info_t info,
const input_driver_t **input, void **input_data)
input_driver_t **input, void **input_data)
{
size_t max_size;
thread_packet_t pkt = {CMD_INIT};
@ -1362,7 +1362,7 @@ static void video_thread_set_callbacks(
* Returns: true (1) if successful, otherwise false (0).
**/
bool video_init_thread(const video_driver_t **out_driver,
void **out_data, const input_driver_t **input, void **input_data,
void **out_data, input_driver_t **input, void **input_data,
const video_driver_t *drv, const video_info_t info)
{
thread_video_t *thr = (thread_video_t*)calloc(1, sizeof(*thr));

View File

@ -53,7 +53,7 @@ typedef struct thread_video thread_video_t;
**/
bool video_init_thread(
const video_driver_t **out_driver, void **out_data,
const input_driver_t **input, void **input_data,
input_driver_t **input, void **input_data,
const video_driver_t *driver, const video_info_t info);
/**

View File

@ -149,7 +149,6 @@ typedef struct state_device
typedef struct android_input
{
bool blocked;
const input_device_driver_t *joypad;
state_device_t pad_states[MAX_USERS];
@ -1692,22 +1691,6 @@ static const input_device_driver_t *android_input_get_joypad_driver(void *data)
return android->joypad;
}
static bool android_input_keyboard_mapping_is_blocked(void *data)
{
android_input_t *android = (android_input_t*)data;
if (!android)
return false;
return android->blocked;
}
static void android_input_keyboard_mapping_set_block(void *data, bool value)
{
android_input_t *android = (android_input_t*)data;
if (!android)
return;
android->blocked = value;
}
static void android_input_grab_mouse(void *data, bool state)
{
(void)data;
@ -1816,6 +1799,5 @@ input_driver_t input_android = {
android_input_set_rumble,
android_input_get_joypad_driver,
NULL,
android_input_keyboard_mapping_is_blocked,
android_input_keyboard_mapping_set_block,
false
};

View File

@ -463,22 +463,6 @@ static const input_device_driver_t *cocoa_input_get_joypad_driver(void *data)
return NULL;
}
static bool cocoa_input_keyboard_mapping_is_blocked(void *data)
{
cocoa_input_data_t *apple = (cocoa_input_data_t*)data;
if (!apple)
return false;
return apple->blocked;
}
static void cocoa_input_keyboard_mapping_set_block(void *data, bool value)
{
cocoa_input_data_t *apple = (cocoa_input_data_t*)data;
if (!apple)
return;
apple->blocked = value;
}
input_driver_t input_cocoa = {
cocoa_input_init,
cocoa_input_poll,
@ -493,6 +477,5 @@ input_driver_t input_cocoa = {
cocoa_input_set_rumble,
cocoa_input_get_joypad_driver,
cocoa_input_get_sec_joypad_driver,
cocoa_input_keyboard_mapping_is_blocked,
cocoa_input_keyboard_mapping_set_block,
false
};

View File

@ -34,7 +34,6 @@ typedef struct
typedef struct
{
bool blocked;
cocoa_touch_data_t touches[MAX_TOUCHES];
uint32_t touch_count;

View File

@ -32,7 +32,6 @@
typedef struct ctr_input
{
bool blocked;
const input_device_driver_t *joypad;
} ctr_input_t;
@ -162,22 +161,6 @@ static bool ctr_input_set_rumble(void *data, unsigned port,
return false;
}
static bool ctr_input_keyboard_mapping_is_blocked(void *data)
{
ctr_input_t *ctr = (ctr_input_t*)data;
if (!ctr)
return false;
return ctr->blocked;
}
static void ctr_input_keyboard_mapping_set_block(void *data, bool value)
{
ctr_input_t *ctr = (ctr_input_t*)data;
if (!ctr)
return;
ctr->blocked = value;
}
input_driver_t input_ctr = {
ctr_input_init,
ctr_input_poll,
@ -192,6 +175,5 @@ input_driver_t input_ctr = {
ctr_input_set_rumble,
ctr_input_get_joypad_driver,
NULL,
ctr_input_keyboard_mapping_is_blocked,
ctr_input_keyboard_mapping_set_block,
false
};

View File

@ -73,7 +73,6 @@ struct pointer_status
struct dinput_input
{
char *joypad_driver_name;
bool blocked;
LPDIRECTINPUTDEVICE8 keyboard;
LPDIRECTINPUTDEVICE8 mouse;
const input_device_driver_t *joypad;
@ -572,7 +571,7 @@ static int16_t dinput_input_state(void *data,
if (binds[port][i].key < RETROK_LAST)
{
if (di->state[rarch_keysym_lut[(enum retro_key)binds[port][i].key]] & 0x80)
if ((i == RARCH_GAME_FOCUS_TOGGLE) || !di->blocked)
if ((i == RARCH_GAME_FOCUS_TOGGLE) || !input_dinput.keyboard_mapping_blocked)
{
ret |= (1 << i);
continue;
@ -618,7 +617,7 @@ static int16_t dinput_input_state(void *data,
if (binds[port][id].key < RETROK_LAST)
{
if (di->state[rarch_keysym_lut[(enum retro_key)binds[port][id].key]] & 0x80)
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !di->blocked)
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !input_dinput.keyboard_mapping_blocked)
return true;
}
if (binds[port][id].valid)
@ -730,7 +729,7 @@ static int16_t dinput_input_state(void *data,
if (binds[port][new_id].key < RETROK_LAST)
{
if (di->state[rarch_keysym_lut[(enum retro_key)binds[port][new_id].key]] & 0x80)
if ((new_id == RARCH_GAME_FOCUS_TOGGLE) || !di->blocked)
if ((new_id == RARCH_GAME_FOCUS_TOGGLE) || !input_dinput.keyboard_mapping_blocked)
return true;
}
if (binds[port][new_id].valid)
@ -1012,22 +1011,6 @@ static uint64_t dinput_get_capabilities(void *data)
return caps;
}
static bool dinput_keyboard_mapping_is_blocked(void *data)
{
struct dinput_input *di = (struct dinput_input*)data;
if (!di)
return false;
return di->blocked;
}
static void dinput_keyboard_mapping_set_block(void *data, bool value)
{
struct dinput_input *di = (struct dinput_input*)data;
if (!di)
return;
di->blocked = value;
}
input_driver_t input_dinput = {
dinput_init,
dinput_poll,
@ -1043,6 +1026,5 @@ input_driver_t input_dinput = {
dinput_set_rumble,
dinput_get_joypad_driver,
NULL,
dinput_keyboard_mapping_is_blocked,
dinput_keyboard_mapping_set_block,
false
};

View File

@ -215,6 +215,5 @@ input_driver_t input_dos = {
dos_input_set_rumble,
dos_input_get_joypad_driver,
NULL,
NULL,
NULL
false
};

View File

@ -34,7 +34,6 @@
typedef struct gx_input
{
bool blocked;
const input_device_driver_t *joypad;
} gx_input_t;
@ -166,22 +165,6 @@ static bool gx_input_set_rumble(void *data, unsigned port,
return false;
}
static bool gx_input_keyboard_mapping_is_blocked(void *data)
{
gx_input_t *gx = (gx_input_t*)data;
if (!gx)
return false;
return gx->blocked;
}
static void gx_input_keyboard_mapping_set_block(void *data, bool value)
{
gx_input_t *gx = (gx_input_t*)data;
if (!gx)
return;
gx->blocked = value;
}
input_driver_t input_gx = {
gx_input_init,
gx_input_poll,
@ -197,6 +180,5 @@ input_driver_t input_gx = {
gx_input_set_rumble,
gx_input_get_joypad_driver,
NULL,
gx_input_keyboard_mapping_is_blocked,
gx_input_keyboard_mapping_set_block,
false
};

View File

@ -37,7 +37,6 @@
typedef struct linuxraw_input
{
bool blocked;
const input_device_driver_t *joypad;
bool state[0x80];
} linuxraw_input_t;
@ -259,22 +258,6 @@ static void linuxraw_grab_mouse(void *data, bool state)
(void)state;
}
static bool linuxraw_keyboard_mapping_is_blocked(void *data)
{
linuxraw_input_t *linuxraw = (linuxraw_input_t*)data;
if (!linuxraw)
return false;
return linuxraw->blocked;
}
static void linuxraw_keyboard_mapping_set_block(void *data, bool value)
{
linuxraw_input_t *linuxraw = (linuxraw_input_t*)data;
if (!linuxraw)
return;
linuxraw->blocked = value;
}
input_driver_t input_linuxraw = {
linuxraw_input_init,
linuxraw_input_poll,
@ -289,6 +272,5 @@ input_driver_t input_linuxraw = {
linuxraw_set_rumble,
linuxraw_get_joypad_driver,
NULL,
linuxraw_keyboard_mapping_is_blocked,
linuxraw_keyboard_mapping_set_block,
false
};

View File

@ -80,13 +80,6 @@ static bool nullinput_set_rumble(void *data, unsigned port,
return false;
}
static bool nullinput_keyboard_mapping_is_blocked(void *data)
{
(void)data;
return false;
}
input_driver_t input_null = {
nullinput_input_init,
nullinput_input_poll,
@ -101,6 +94,5 @@ input_driver_t input_null = {
nullinput_set_rumble,
NULL,
NULL,
nullinput_keyboard_mapping_is_blocked,
NULL,
false,
};

View File

@ -30,7 +30,6 @@
typedef struct ps2_input
{
bool blocked;
const input_device_driver_t *joypad;
} ps2_input_t;
@ -155,22 +154,6 @@ static bool ps2_input_set_rumble(void *data, unsigned port,
return false;
}
static bool ps2_input_keyboard_mapping_is_blocked(void *data)
{
ps2_input_t *ps2 = (ps2_input_t*)data;
if (!ps2)
return false;
return ps2->blocked;
}
static void ps2_input_keyboard_mapping_set_block(void *data, bool value)
{
ps2_input_t *ps2 = (ps2_input_t*)data;
if (!ps2)
return;
ps2->blocked = value;
}
input_driver_t input_ps2 = {
ps2_input_initialize,
ps2_input_poll,
@ -185,6 +168,5 @@ input_driver_t input_ps2 = {
ps2_input_set_rumble,
ps2_input_get_joypad_driver,
NULL,
ps2_input_keyboard_mapping_is_blocked,
ps2_input_keyboard_mapping_set_block,
false
};

View File

@ -48,7 +48,6 @@ typedef struct
typedef struct ps3_input
{
bool blocked;
#ifdef HAVE_MOUSE
unsigned mice_connected;
#endif
@ -278,22 +277,6 @@ static void ps3_input_grab_mouse(void *data, bool state)
(void)state;
}
static bool ps3_input_keyboard_mapping_is_blocked(void *data)
{
ps3_input_t *ps3 = (ps3_input_t*)data;
if (!ps3)
return false;
return ps3->blocked;
}
static void ps3_input_keyboard_mapping_set_block(void *data, bool value)
{
ps3_input_t *ps3 = (ps3_input_t*)data;
if (!ps3)
return;
ps3->blocked = value;
}
input_driver_t input_ps3 = {
ps3_input_init,
ps3_input_poll,
@ -309,6 +292,5 @@ input_driver_t input_ps3 = {
ps3_input_set_rumble,
ps3_input_get_joypad_driver,
NULL,
ps3_input_keyboard_mapping_is_blocked,
ps3_input_keyboard_mapping_set_block,
false
};

View File

@ -34,7 +34,6 @@
typedef struct ps4_input
{
bool blocked;
const input_device_driver_t *joypad;
} ps4_input_t;
@ -159,22 +158,6 @@ static bool ps4_input_set_rumble(void *data, unsigned port,
return false;
}
static bool ps4_input_keyboard_mapping_is_blocked(void *data)
{
ps4_input_t *ps4 = (ps4_input_t*)data;
if (!ps4)
return false;
return ps4->blocked;
}
static void ps4_input_keyboard_mapping_set_block(void *data, bool value)
{
ps4_input_t *ps4 = (ps4_input_t*)data;
if (!ps4)
return;
ps4->blocked = value;
}
input_driver_t input_ps4 = {
ps4_input_initialize,
ps4_input_poll,
@ -189,6 +172,5 @@ input_driver_t input_ps4 = {
ps4_input_set_rumble,
ps4_input_get_joypad_driver,
NULL,
ps4_input_keyboard_mapping_is_blocked,
ps4_input_keyboard_mapping_set_block,
false
};

View File

@ -72,7 +72,6 @@ uint8_t modifier_lut[VITA_NUM_MODIFIERS][2] =
typedef struct psp_input
{
bool blocked;
const input_device_driver_t *joypad;
#ifdef VITA
int keyboard_hid_handle;
@ -446,22 +445,6 @@ static bool psp_input_set_rumble(void *data, unsigned port,
return false;
}
static bool psp_input_keyboard_mapping_is_blocked(void *data)
{
psp_input_t *psp = (psp_input_t*)data;
if (!psp)
return false;
return psp->blocked;
}
static void psp_input_keyboard_mapping_set_block(void *data, bool value)
{
psp_input_t *psp = (psp_input_t*)data;
if (!psp)
return;
psp->blocked = value;
}
input_driver_t input_psp = {
psp_input_initialize,
psp_input_poll,
@ -481,6 +464,5 @@ input_driver_t input_psp = {
psp_input_set_rumble,
psp_input_get_joypad_driver,
NULL,
psp_input_keyboard_mapping_is_blocked,
psp_input_keyboard_mapping_set_block,
false
};

View File

@ -77,7 +77,6 @@ struct input_pointer
typedef struct qnx_input
{
bool blocked;
unsigned pads_connected;
/*
@ -739,7 +738,7 @@ static bool qnx_is_pressed(qnx_input_t *qnx,
return false;
if (qnx_keyboard_pressed(qnx, key))
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !qnx->blocked)
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !input_qnx.keyboard_mapping_blocked)
return true;
if (binds && binds[id].valid)
@ -858,22 +857,6 @@ static const input_device_driver_t *qnx_input_get_joypad_driver(void *data)
return qnx->joypad;
}
static bool qnx_input_keyboard_mapping_is_blocked(void *data)
{
qnx_input_t *qnx = (qnx_input_t*)data;
if (!qnx)
return false;
return qnx->blocked;
}
static void qnx_input_keyboard_mapping_set_block(void *data, bool value)
{
qnx_input_t *qnx = (qnx_input_t*)data;
if (!qnx)
return;
qnx->blocked = value;
}
input_driver_t input_qnx = {
qnx_input_init,
qnx_input_poll,
@ -888,6 +871,5 @@ input_driver_t input_qnx = {
NULL,
qnx_input_get_joypad_driver,
NULL,
qnx_input_keyboard_mapping_is_blocked,
qnx_input_keyboard_mapping_set_block,
false
};

View File

@ -75,7 +75,6 @@ typedef struct rwebinput_input
bool keys[RETROK_LAST];
rwebinput_mouse_state_t mouse;
const input_device_driver_t *joypad;
bool blocked;
} rwebinput_input_t;
/* KeyboardEvent.keyCode has been deprecated for a while and doesn't have
@ -480,7 +479,7 @@ static bool rwebinput_is_pressed(rwebinput_input_t *rwebinput,
int key = bind->key;
if ((key < RETROK_LAST) && rwebinput_key_pressed(rwebinput, key))
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !rwebinput->blocked)
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !input_rwebinput.keyboard_mapping_blocked)
return true;
if (bind->valid)
@ -700,22 +699,6 @@ static uint64_t rwebinput_get_capabilities(void *data)
return caps;
}
static bool rwebinput_keyboard_mapping_is_blocked(void *data)
{
rwebinput_input_t *rwebinput = (rwebinput_input_t*)data;
if (!rwebinput)
return false;
return rwebinput->blocked;
}
static void rwebinput_keyboard_mapping_set_block(void *data, bool value)
{
rwebinput_input_t *rwebinput = (rwebinput_input_t*)data;
if (!rwebinput)
return;
rwebinput->blocked = value;
}
input_driver_t input_rwebinput = {
rwebinput_input_init,
rwebinput_input_poll,
@ -730,6 +713,5 @@ input_driver_t input_rwebinput = {
rwebinput_set_rumble,
rwebinput_get_joypad_driver,
NULL,
rwebinput_keyboard_mapping_is_blocked,
rwebinput_keyboard_mapping_set_block,
false
};

View File

@ -35,7 +35,6 @@
typedef struct sdl_input
{
bool blocked;
const input_device_driver_t *joypad;
int mouse_x, mouse_y;
@ -421,22 +420,6 @@ static uint64_t sdl_get_capabilities(void *data)
return caps;
}
static bool sdl_keyboard_mapping_is_blocked(void *data)
{
sdl_input_t *sdl = (sdl_input_t*)data;
if (!sdl)
return false;
return sdl->blocked;
}
static void sdl_keyboard_mapping_set_block(void *data, bool value)
{
sdl_input_t *sdl = (sdl_input_t*)data;
if (!sdl)
return;
sdl->blocked = value;
}
input_driver_t input_sdl = {
sdl_input_init,
sdl_input_poll,
@ -455,6 +438,5 @@ input_driver_t input_sdl = {
sdl_set_rumble,
sdl_get_joypad_driver,
NULL,
sdl_keyboard_mapping_is_blocked,
sdl_keyboard_mapping_set_block,
false
};

View File

@ -88,7 +88,6 @@ typedef struct
typedef struct switch_input
{
const input_device_driver_t *joypad;
bool blocked;
#ifdef HAVE_LIBNX
/* pointer */
@ -901,22 +900,6 @@ static bool switch_input_set_rumble(void *data, unsigned port,
#endif
}
static bool switch_input_keyboard_mapping_is_blocked(void *data)
{
switch_input_t *sw = (switch_input_t*) data;
if (!sw)
return false;
return sw->blocked;
}
static void switch_input_keyboard_mapping_set_block(void *data, bool value)
{
switch_input_t *sw = (switch_input_t*) data;
if (!sw)
return;
sw->blocked = value;
}
input_driver_t input_switch = {
switch_input_init,
switch_input_poll,
@ -931,6 +914,5 @@ input_driver_t input_switch = {
switch_input_set_rumble,
switch_input_get_joypad_driver,
NULL,
switch_input_keyboard_mapping_is_blocked,
switch_input_keyboard_mapping_set_block,
false
};

View File

@ -129,7 +129,6 @@ typedef void (*device_handle_cb)(void *data,
struct udev_input
{
bool blocked;
struct udev *udev;
struct udev_monitor *monitor;
@ -938,7 +937,7 @@ static bool udev_is_pressed(udev_input_t *udev,
const struct retro_keybind *bind = &binds[id];
if ( (bind->key < RETROK_LAST) && udev_keyboard_pressed(udev, bind->key) )
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !udev->blocked)
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !input_udev.keyboard_mapping_blocked)
return true;
if (binds && binds[id].valid)
@ -1345,22 +1344,6 @@ static const input_device_driver_t *udev_input_get_joypad_driver(void *data)
return udev->joypad;
}
static bool udev_input_keyboard_mapping_is_blocked(void *data)
{
udev_input_t *udev = (udev_input_t*)data;
if (!udev)
return false;
return udev->blocked;
}
static void udev_input_keyboard_mapping_set_block(void *data, bool value)
{
udev_input_t *udev = (udev_input_t*)data;
if (!udev)
return;
udev->blocked = value;
}
input_driver_t input_udev = {
udev_input_init,
udev_input_poll,
@ -1379,6 +1362,5 @@ input_driver_t input_udev = {
udev_input_set_rumble,
udev_input_get_joypad_driver,
NULL,
udev_input_keyboard_mapping_is_blocked,
udev_input_keyboard_mapping_set_block,
false
};

View File

@ -31,7 +31,6 @@
typedef struct uwp_input
{
bool blocked;
const input_device_driver_t *joypad;
} uwp_input_t;
@ -107,22 +106,6 @@ static void uwp_input_grab_mouse(void *data, bool state)
(void)state;
}
static bool uwp_keyboard_mapping_is_blocked(void *data)
{
uwp_input_t *uwp = (uwp_input_t*)data;
if (!uwp)
return false;
return uwp->blocked;
}
static void uwp_keyboard_mapping_set_block(void *data, bool value)
{
uwp_input_t *uwp = (uwp_input_t*)data;
if (!uwp)
return;
uwp->blocked = value;
}
static bool uwp_pressed_joypad(uwp_input_t *uwp,
rarch_joypad_info_t joypad_info,
const struct retro_keybind *binds,
@ -132,7 +115,7 @@ static bool uwp_pressed_joypad(uwp_input_t *uwp,
/* First, process the keyboard bindings */
if ((bind->key < RETROK_LAST) && uwp_keyboard_pressed(bind->key))
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !uwp->blocked)
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !input_uwp.keyboard_mapping_blocked)
return true;
/* Then, process the joypad bindings */
@ -252,6 +235,5 @@ input_driver_t input_uwp = {
uwp_input_set_rumble,
uwp_input_get_joypad_driver,
NULL,
uwp_keyboard_mapping_is_blocked,
uwp_keyboard_mapping_set_block,
false
};

View File

@ -438,22 +438,6 @@ static const input_device_driver_t *input_wl_get_joypad_driver(void *data)
return wl->joypad;
}
static bool input_wl_keyboard_mapping_is_blocked(void *data)
{
input_ctx_wayland_data_t *wl = (input_ctx_wayland_data_t*)data;
if (!wl)
return false;
return wl->blocked;
}
static void input_wl_keyboard_mapping_set_block(void *data, bool value)
{
input_ctx_wayland_data_t *wl = (input_ctx_wayland_data_t*)data;
if (!wl)
return;
wl->blocked = value;
}
input_driver_t input_wayland = {
NULL,
input_wl_poll,
@ -468,6 +452,5 @@ input_driver_t input_wayland = {
input_wl_set_rumble,
input_wl_get_joypad_driver,
NULL,
input_wl_keyboard_mapping_is_blocked,
input_wl_keyboard_mapping_set_block,
false
};

View File

@ -40,7 +40,6 @@ static bool keyboardState[RETROK_LAST] = { 0 };
typedef struct wiiu_input
{
bool blocked;
const input_device_driver_t *joypad;
} wiiu_input_t;
@ -259,22 +258,6 @@ static bool wiiu_input_set_rumble(void *data, unsigned port,
return false;
}
static bool wiiu_input_keyboard_mapping_is_blocked(void *data)
{
wiiu_input_t *wiiu = (wiiu_input_t*)data;
if (!wiiu)
return false;
return wiiu->blocked;
}
static void wiiu_input_keyboard_mapping_set_block(void *data, bool value)
{
wiiu_input_t *wiiu = (wiiu_input_t*)data;
if (!wiiu)
return;
wiiu->blocked = value;
}
input_driver_t input_wiiu = {
wiiu_input_init,
wiiu_input_poll,
@ -289,6 +272,5 @@ input_driver_t input_wiiu = {
wiiu_input_set_rumble,
wiiu_input_get_joypad_driver,
NULL,
wiiu_input_keyboard_mapping_is_blocked,
wiiu_input_keyboard_mapping_set_block,
false
};

View File

@ -36,7 +36,6 @@ typedef struct
typedef struct
{
bool kbd_mapp_block;
bool mouse_grab;
winraw_keyboard_t keyboard;
HWND window;
@ -401,7 +400,7 @@ static bool winraw_is_pressed(winraw_input_t *wr,
const struct retro_keybind *bind = &binds[id];
if ((bind->key < RETROK_LAST) && winraw_keyboard_pressed(wr, bind->key))
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !wr->kbd_mapp_block)
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !input_winraw.keyboard_mapping_blocked)
return true;
if (binds && binds[id].valid)
{
@ -843,20 +842,6 @@ static const input_device_driver_t *winraw_get_joypad_driver(void *d)
return wr->joypad;
}
static bool winraw_keyboard_mapping_is_blocked(void *d)
{
winraw_input_t *wr = (winraw_input_t*)d;
return wr->kbd_mapp_block;
}
static void winraw_keyboard_mapping_set_block(void *d, bool block)
{
winraw_input_t *wr = (winraw_input_t*)d;
wr->kbd_mapp_block = block;
}
input_driver_t input_winraw = {
winraw_init,
winraw_poll,
@ -871,6 +856,5 @@ input_driver_t input_winraw = {
winraw_set_rumble,
winraw_get_joypad_driver,
NULL,
winraw_keyboard_mapping_is_blocked,
winraw_keyboard_mapping_set_block,
false
};

View File

@ -34,7 +34,6 @@
typedef struct x11_input
{
bool blocked;
const input_device_driver_t *joypad;
Display *display;
@ -132,7 +131,7 @@ static bool x_is_pressed(x11_input_t *x11,
const struct retro_keybind *bind = &binds[id];
if ((bind->key < RETROK_LAST) && x_keyboard_pressed(x11, bind->key) )
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !x11->blocked)
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !input_x.keyboard_mapping_blocked)
return true;
if (binds && binds[id].valid)
@ -533,22 +532,6 @@ static uint64_t x_input_get_capabilities(void *data)
return caps;
}
static bool x_keyboard_mapping_is_blocked(void *data)
{
x11_input_t *x11 = (x11_input_t*)data;
if (!x11)
return false;
return x11->blocked;
}
static void x_keyboard_mapping_set_block(void *data, bool value)
{
x11_input_t *x11 = (x11_input_t*)data;
if (!x11)
return;
x11->blocked = value;
}
input_driver_t input_x = {
x_input_init,
x_input_poll,
@ -563,6 +546,5 @@ input_driver_t input_x = {
x_set_rumble,
x_get_joypad_driver,
NULL,
x_keyboard_mapping_is_blocked,
x_keyboard_mapping_set_block,
false
};

View File

@ -37,7 +37,6 @@
typedef struct xdk_input
{
bool blocked;
const input_device_driver_t *joypad;
} xdk_input_t;
@ -196,22 +195,6 @@ static void xdk_input_grab_mouse(void *data, bool state)
(void)state;
}
static bool xdk_keyboard_mapping_is_blocked(void *data)
{
xdk_input_t *xdk = (xdk_input_t*)data;
if (!xdk)
return false;
return xdk->blocked;
}
static void xdk_keyboard_mapping_set_block(void *data, bool value)
{
xdk_input_t *xdk = (xdk_input_t*)data;
if (!xdk)
return;
xdk->blocked = value;
}
input_driver_t input_xinput = {
xdk_input_init,
xdk_input_poll,
@ -226,6 +209,5 @@ input_driver_t input_xinput = {
xdk_input_set_rumble,
xdk_input_get_joypad_driver,
NULL,
xdk_keyboard_mapping_is_blocked,
xdk_keyboard_mapping_set_block,
false
};

View File

@ -146,6 +146,5 @@ input_driver_t input_xenon360 = {
NULL,
xenon360_input_set_rumble,
NULL,
NULL,
NULL,
false
};

View File

@ -164,8 +164,7 @@ struct input_driver
enum retro_rumble_effect effect, uint16_t state);
const input_device_driver_t *(*get_joypad_driver)(void *data);
const input_device_driver_t *(*get_sec_joypad_driver)(void *data);
bool (*keyboard_mapping_is_blocked)(void *data);
void (*keyboard_mapping_set_block)(void *data, bool value);
bool keyboard_mapping_blocked;
};
struct rarch_joypad_driver
@ -228,8 +227,6 @@ const input_device_driver_t * input_driver_get_joypad_driver(void);
const input_device_driver_t * input_driver_get_sec_joypad_driver(void);
void input_driver_keyboard_mapping_set_block(bool value);
/**
* input_sensor_set_state:
* @port : User number.
@ -249,7 +246,7 @@ void *input_driver_get_data(void);
void input_get_state_for_port(
void *data, unsigned port, input_bits_t *p_new_state);
const input_driver_t *input_get_ptr(void);
input_driver_t *input_get_ptr(void);
void *input_get_data(void);

View File

@ -221,7 +221,7 @@ static void menu_input_key_bind_poll_bind_state(
{
unsigned b;
rarch_joypad_info_t joypad_info;
const input_driver_t *input_ptr = input_get_ptr();
input_driver_t *input_ptr = input_get_ptr();
void *input_data = input_get_data();
const input_device_driver_t *joypad =
input_driver_get_joypad_driver();
@ -554,7 +554,10 @@ bool menu_input_key_bind_iterate(menu_input_ctx_bind_t *bind)
if (rarch_timer_has_expired(&menu_input_binds.timer_timeout))
{
input_driver_keyboard_mapping_set_block(false);
input_driver_t *input_drv = input_get_ptr();
if (input_drv)
input_drv->keyboard_mapping_blocked = false;
/*skip to next bind*/
menu_input_binds.begin++;
@ -578,11 +581,13 @@ bool menu_input_key_bind_iterate(menu_input_ctx_bind_t *bind)
}
{
bool complete = false;
struct menu_bind_state binds;
binds = menu_input_binds;
bool complete = false;
struct menu_bind_state binds = menu_input_binds;
input_driver_t *input_drv = input_get_ptr();
if (input_drv)
input_drv->keyboard_mapping_blocked = true;
input_driver_keyboard_mapping_set_block( true );
menu_input_key_bind_poll_bind_state( &binds, menu_bind_port, timed_out );
#ifdef ANDROID
@ -627,10 +632,13 @@ bool menu_input_key_bind_iterate(menu_input_ctx_bind_t *bind)
if ( complete )
{
input_driver_t *input_drv = input_get_ptr();
/*update bind*/
*( binds.output ) = binds.buffer;
input_driver_keyboard_mapping_set_block( false );
if (input_drv)
input_drv->keyboard_mapping_blocked = false;
/* Avoid new binds triggering things right away. */
input_driver_set_flushing_input();

View File

@ -499,7 +499,7 @@ static const gfx_ctx_driver_t *gfx_ctx_drivers[] = {
};
static const input_driver_t *input_drivers[] = {
static input_driver_t *input_drivers[] = {
#ifdef ORBIS
&input_ps4,
#endif
@ -1623,7 +1623,7 @@ static command_t *input_driver_command = NULL;
static input_remote_t *input_driver_remote = NULL;
#endif
static input_mapper_t *input_driver_mapper = NULL;
static const input_driver_t *current_input = NULL;
static input_driver_t *current_input = NULL;
static void *current_input_data = NULL;
static bool input_driver_block_hotkey = false;
static bool input_driver_block_libretro_input = false;
@ -1750,7 +1750,7 @@ const ui_companion_driver_t *ui_companion_get_ptr(void)
return ui_companion;
}
const input_driver_t *input_get_ptr(void)
input_driver_t *input_get_ptr(void)
{
return current_input;
}
@ -3975,7 +3975,7 @@ bool command_event(enum event_command cmd, void *data)
case CMD_EVENT_REINIT:
video_driver_reinit();
{
const input_driver_t *input_drv = current_input;
input_driver_t *input_drv = current_input;
void *input_data = current_input_data;
/* Poll input to avoid possibly stale data to corrupt things. */
if (input_drv && input_drv->poll)
@ -4798,7 +4798,7 @@ TODO: Add a setting for these tweaks */
input_driver_grab_mouse();
video_driver_hide_mouse();
input_driver_set_hotkey_block();
input_driver_keyboard_mapping_set_block(1);
current_input->keyboard_mapping_blocked = true;
if (mode != -1)
runloop_msg_queue_push(msg_hash_to_str(MSG_GAME_FOCUS_ON),
1, 120, true,
@ -4809,7 +4809,7 @@ TODO: Add a setting for these tweaks */
input_driver_ungrab_mouse();
video_driver_show_mouse();
input_driver_unset_hotkey_block();
input_driver_keyboard_mapping_set_block(0);
current_input->keyboard_mapping_blocked = false;
if (mode != -1)
runloop_msg_queue_push(msg_hash_to_str(MSG_GAME_FOCUS_OFF),
1, 120, true,
@ -10232,7 +10232,7 @@ static void input_poll_overlay(input_overlay_t *ol, float opacity,
bool button_pressed = false;
void *input_data = current_input_data;
input_overlay_state_t *ol_state = &ol->overlay_state;
const input_driver_t *input_ptr = current_input;
input_driver_t *input_ptr = current_input;
if (!ol_state)
return;
@ -10560,7 +10560,7 @@ const void *input_driver_find_handle(int idx)
**/
const char *input_driver_find_ident(int idx)
{
const input_driver_t *drv = input_drivers[idx];
input_driver_t *drv = input_drivers[idx];
if (!drv)
return NULL;
return drv->ident;
@ -10622,12 +10622,6 @@ uint64_t input_driver_get_capabilities(void)
return current_input->get_capabilities(current_input_data);
}
void input_driver_keyboard_mapping_set_block(bool value)
{
if (current_input->keyboard_mapping_set_block)
current_input->keyboard_mapping_set_block(current_input_data, value);
}
/**
* input_sensor_set_state:
* @port : User number.
@ -12449,8 +12443,7 @@ static bool input_driver_find_driver(void)
i = (int)drv.len;
if (i >= 0)
current_input = (const input_driver_t*)
input_driver_find_handle(i);
current_input = (input_driver_t*)input_driver_find_handle(i);
else
{
unsigned d;
@ -12461,8 +12454,7 @@ static bool input_driver_find_driver(void)
RARCH_LOG_OUTPUT("\t%s\n", input_driver_find_ident(d));
RARCH_WARN("Going to default to first input driver...\n");
current_input = (const input_driver_t*)
input_driver_find_handle(0);
current_input = (input_driver_t*)input_driver_find_handle(0);
if (!current_input)
{
@ -13191,8 +13183,7 @@ const char **input_keyboard_start_line(void *userdata,
g_keyboard_line->userdata = userdata;
/* While reading keyboard line input, we have to block all hotkeys. */
if (current_input->keyboard_mapping_set_block)
current_input->keyboard_mapping_set_block(current_input_data, true);
current_input->keyboard_mapping_blocked = true;
return (const char**)&g_keyboard_line->buffer;
}
@ -13219,8 +13210,7 @@ void input_keyboard_event(bool down, unsigned code,
g_keyboard_press_cb = NULL;
g_keyboard_press_data = NULL;
if (current_input->keyboard_mapping_set_block)
current_input->keyboard_mapping_set_block(current_input_data, false);
current_input->keyboard_mapping_blocked = false;
deferred_wait_keys = false;
}
else if (g_keyboard_press_cb)
@ -13252,8 +13242,7 @@ void input_keyboard_event(bool down, unsigned code,
input_keyboard_ctl(RARCH_INPUT_KEYBOARD_CTL_LINE_FREE, NULL);
/* Unblock all hotkeys. */
if (current_input->keyboard_mapping_set_block)
current_input->keyboard_mapping_set_block(current_input_data, false);
current_input->keyboard_mapping_blocked = false;
}
else
{
@ -13288,14 +13277,12 @@ bool input_keyboard_ctl(enum rarch_input_keyboard_ctl_state state, void *data)
}
/* While waiting for input, we have to block all hotkeys. */
if (current_input->keyboard_mapping_set_block)
current_input->keyboard_mapping_set_block(current_input_data, true);
current_input->keyboard_mapping_blocked = true;
break;
case RARCH_INPUT_KEYBOARD_CTL_CANCEL_WAIT_KEYS:
g_keyboard_press_cb = NULL;
g_keyboard_press_data = NULL;
if (current_input->keyboard_mapping_set_block)
current_input->keyboard_mapping_set_block(current_input_data, false);
current_input->keyboard_mapping_blocked = false;
break;
case RARCH_INPUT_KEYBOARD_CTL_SET_LINEFEED_ENABLED:
input_driver_keyboard_linefeed_enable = true;
@ -16606,9 +16593,9 @@ static void video_driver_init_filter(enum retro_pixel_format colfmt_int)
video_driver_state_buffer = buf;
}
static void video_driver_init_input(const input_driver_t *tmp)
static void video_driver_init_input(input_driver_t *tmp)
{
const input_driver_t **input = &current_input;
input_driver_t **input = &current_input;
if (*input)
return;
@ -16711,6 +16698,7 @@ static void video_driver_free_internal(void)
{
if (current_input && current_input->free)
current_input->free(current_input_data);
current_input->keyboard_mapping_blocked = false;
current_input_data = NULL;
}
@ -16796,7 +16784,7 @@ static bool video_driver_init_internal(bool *video_is_threaded)
video_info_t video;
unsigned max_dim, scale, width, height;
video_viewport_t *custom_vp = NULL;
const input_driver_t *tmp = NULL;
input_driver_t *tmp = NULL;
rarch_system_info_t *system = NULL;
static uint16_t dummy_pixels[32] = {0};
settings_t *settings = configuration_settings;
@ -22825,11 +22813,9 @@ static enum runloop_state runloop_check_state(
input_driver_block_libretro_input = false;
input_driver_block_hotkey = false;
if ( current_input->keyboard_mapping_is_blocked
&& current_input->keyboard_mapping_is_blocked(current_input_data))
if (current_input->keyboard_mapping_blocked)
input_driver_block_hotkey = true;
#ifdef HAVE_MENU
if (menu_is_alive && !(settings->bools.menu_unified_controls && !menu_input_dialog_get_display_kb()))
input_menu_keys_pressed(&current_bits);
@ -24183,7 +24169,7 @@ static bool rarch_write_debug_info(void)
{
gfx_ctx_ident_t ident_info = {0};
const input_driver_t *input_driver;
input_driver_t *input_driver;
const input_device_driver_t *joypad_driver;
const char *driver;
#ifdef HAVE_MENU

View File

@ -1290,7 +1290,7 @@ typedef struct gfx_ctx_driver
/* Most video backends will want to use a certain input driver.
* Checks for it here. */
void (*input_driver)(void*, const char *, const input_driver_t**, void**);
void (*input_driver)(void*, const char *, input_driver_t**, void**);
/* Wraps whatever gl_proc_address() there is.
* Does not take opaque, to avoid lots of ugly wrapper code. */
@ -1373,7 +1373,7 @@ typedef struct gfx_ctx_image
typedef struct gfx_ctx_input
{
const input_driver_t **input;
input_driver_t **input;
void **input_data;
} gfx_ctx_input_t;
@ -1454,7 +1454,7 @@ typedef struct video_driver
* to override the settings in case the video driver relies on
* input driver for event handling. */
void *(*init)(const video_info_t *video,
const input_driver_t **input,
input_driver_t **input,
void **input_data);
/* Updates frame on the screen.