Skip to content

Commit db0be67

Browse files
committed
Update to input plugin API 2.1.0
1 parent 8205245 commit db0be67

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

src/plugin_front.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,21 @@ EXPORT void CALL ControllerCommand(int Control, unsigned char *Command)
293293
pb_controllerCommand(EMU_2_ADAP_PORT(Control), Command);
294294
}
295295

296-
EXPORT void CALL GetKeys( int Control, BUTTONS *Keys ) { }
296+
#if PLUGIN_VERSION >= 0x010002
297+
void SDL_PumpEvents(void);
298+
#endif
299+
300+
EXPORT void CALL GetKeys( int Control, BUTTONS *Keys )
301+
{
302+
/* Since March 23, 2018, the SDL_PumpEvents() is supposed to be called
303+
by the input plugin. Even though this plugin has nothing to do with
304+
SDL, it must now call SDL_PumpEvents. Otherwise non-input events
305+
such as SDL_QUIT (which occur when one tries to close the window)
306+
are never emitted! */
307+
#if PLUGIN_VERSION >= 0x010002
308+
SDL_PumpEvents();
309+
#endif
310+
}
297311

298312
EXPORT void CALL RomClosed(void)
299313
{

src/version.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828

2929
#define PLUGIN_NAME "Mupen64Plus raphnetraw Input Plugin"
3030
#define PLUGIN_VERSION 0x010002
31-
#define INPUT_PLUGIN_API_VERSION 0x020000
31+
//#define INPUT_PLUGIN_API_VERSION 0x020000
32+
#define INPUT_PLUGIN_API_VERSION 0x020100
3233
#define CONFIG_API_VERSION 0x020100
3334

3435
#define VERSION_PRINTF_SPLIT(x) (((x) >> 16) & 0xffff), (((x) >> 8) & 0xff), ((x) & 0xff)

0 commit comments

Comments
 (0)