From a4a399cd0e7e158bd6b4ac971a82b2512106f242 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 25 Feb 2020 12:14:17 +0100 Subject: [PATCH] Announce that we use keyboard+mouse This allows frontend to remap keys --- Libretro/libretro.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Libretro/libretro.c b/Libretro/libretro.c index 5820d9a..378105d 100644 --- a/Libretro/libretro.c +++ b/Libretro/libretro.c @@ -136,8 +136,20 @@ void _keyboard_cb(bool down, unsigned keycode, risc_keyboard_input(_risc, buf, i); } +static const struct retro_controller_description ports_keyboard[] = +{ + { "Keyboard + Mouse", RETRO_DEVICE_KEYBOARD }, + { 0 }, +}; +static const struct retro_controller_info ports[] = { + { ports_keyboard, 1 }, + { 0 }, +}; + void retro_set_environment(retro_environment_t cb) { - _environ_cb = cb; } + _environ_cb = cb; + _environ_cb(RETRO_ENVIRONMENT_SET_CONTROLLER_INFO, (void*)ports); +} void retro_set_video_refresh(retro_video_refresh_t cb) { _video_cb = cb; }