RetroArch/input/drivers/nullinput.c

125 lines
2.7 KiB
C
Raw Normal View History

2012-06-19 22:44:40 +00:00
/* RetroArch - A frontend for libretro.
2014-01-01 00:50:59 +00:00
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
2016-01-10 03:33:01 +00:00
* Copyright (C) 2011-2016 - Daniel De Matteis
2012-06-19 22:44:40 +00:00
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
2016-09-01 03:48:20 +00:00
#include "../input_driver.h"
#include "../../verbosity.h"
2012-06-19 22:44:40 +00:00
2012-11-26 23:50:29 +00:00
static void *nullinput_input_init(void)
2012-06-19 22:44:40 +00:00
{
RARCH_ERR("Using the null input driver. RetroArch will ignore you.");
2012-06-19 22:44:40 +00:00
return (void*)-1;
}
2012-11-26 23:50:29 +00:00
static void nullinput_input_poll(void *data)
2012-06-19 22:44:40 +00:00
{
(void)data;
}
2014-09-09 16:15:17 +00:00
static int16_t nullinput_input_state(void *data,
const struct retro_keybind **retro_keybinds, unsigned port,
2014-10-20 18:31:00 +00:00
unsigned device, unsigned idx, unsigned id)
2012-06-19 22:44:40 +00:00
{
(void)data;
2012-07-07 15:19:32 +00:00
(void)retro_keybinds;
2012-06-19 22:44:40 +00:00
(void)port;
(void)device;
2014-10-20 18:31:00 +00:00
(void)idx;
2012-06-19 22:44:40 +00:00
(void)id;
return 0;
}
2015-11-07 19:59:12 +00:00
static bool nullinput_input_key_pressed(void *data, int key)
2012-06-19 22:44:40 +00:00
{
(void)data;
(void)key;
return false;
}
2015-11-07 19:59:12 +00:00
static bool nullinput_input_meta_key_pressed(void *data, int key)
2015-07-17 01:31:51 +00:00
{
(void)data;
(void)key;
return false;
}
2012-11-26 23:50:29 +00:00
static void nullinput_input_free_input(void *data)
2012-06-19 22:44:40 +00:00
{
(void)data;
}
static uint64_t nullinput_get_capabilities(void *data)
{
uint64_t caps = 0;
caps |= (1 << RETRO_DEVICE_JOYPAD);
return caps;
}
2014-09-09 16:15:17 +00:00
static bool nullinput_set_sensor_state(void *data,
unsigned port, enum retro_sensor_action action, unsigned event_rate)
2014-01-04 21:52:26 +00:00
{
return false;
}
static void nullinput_grab_mouse(void *data, bool state)
{
(void)data;
(void)state;
}
static bool nullinput_set_rumble(void *data, unsigned port,
enum retro_rumble_effect effect, uint16_t strength)
{
(void)data;
(void)port;
(void)effect;
(void)strength;
return false;
}
2016-10-27 00:34:10 +00:00
static bool nullinput_keyboard_mapping_is_blocked(void *data)
{
(void)data;
return false;
}
2014-09-11 05:06:20 +00:00
input_driver_t input_null = {
2012-11-26 23:50:29 +00:00
nullinput_input_init,
nullinput_input_poll,
nullinput_input_state,
nullinput_input_key_pressed,
2015-07-17 01:31:51 +00:00
nullinput_input_meta_key_pressed,
2012-11-26 23:50:29 +00:00
nullinput_input_free_input,
2014-01-04 21:52:26 +00:00
nullinput_set_sensor_state,
NULL,
nullinput_get_capabilities,
2012-06-19 22:44:40 +00:00
"null",
nullinput_grab_mouse,
NULL,
nullinput_set_rumble,
NULL,
NULL,
2016-10-27 00:34:10 +00:00
nullinput_keyboard_mapping_is_blocked,
2015-11-16 01:39:38 +00:00
NULL,
2012-06-19 22:44:40 +00:00
};