2014-10-27 03:27:48 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2017-01-22 12:40:32 +00:00
|
|
|
* Copyright (C) 2011-2017 - Daniel De Matteis
|
2014-10-27 03:27:48 +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/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INPUT_KEYMAPS_H__
|
|
|
|
#define INPUT_KEYMAPS_H__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2015-12-05 19:05:32 +00:00
|
|
|
|
2016-06-03 03:54:21 +00:00
|
|
|
#include <retro_common_api.h>
|
2016-05-10 17:03:53 +00:00
|
|
|
#include <libretro.h>
|
2014-10-27 03:27:48 +00:00
|
|
|
|
2016-06-03 03:54:21 +00:00
|
|
|
RETRO_BEGIN_DECLS
|
2014-10-27 03:27:48 +00:00
|
|
|
|
|
|
|
struct rarch_key_map
|
|
|
|
{
|
|
|
|
unsigned sym;
|
|
|
|
enum retro_key rk;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct input_key_map
|
|
|
|
{
|
|
|
|
const char *str;
|
|
|
|
enum retro_key key;
|
|
|
|
};
|
2015-11-17 05:25:37 +00:00
|
|
|
|
|
|
|
#ifdef __APPLE__
|
2015-11-17 05:30:11 +00:00
|
|
|
struct apple_key_name_map_entry
|
|
|
|
{
|
|
|
|
const char* const keyname;
|
|
|
|
const uint32_t hid_id;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern const struct apple_key_name_map_entry apple_key_name_map[];
|
2015-11-17 05:25:37 +00:00
|
|
|
#endif
|
|
|
|
|
2014-10-27 03:27:48 +00:00
|
|
|
extern const struct input_key_map input_config_key_map[];
|
|
|
|
|
|
|
|
extern const struct rarch_key_map rarch_key_map_x11[];
|
|
|
|
extern const struct rarch_key_map rarch_key_map_sdl[];
|
|
|
|
extern const struct rarch_key_map rarch_key_map_sdl2[];
|
|
|
|
extern const struct rarch_key_map rarch_key_map_dinput[];
|
|
|
|
extern const struct rarch_key_map rarch_key_map_rwebinput[];
|
|
|
|
extern const struct rarch_key_map rarch_key_map_linux[];
|
|
|
|
extern const struct rarch_key_map rarch_key_map_apple_hid[];
|
2016-01-12 20:48:09 +00:00
|
|
|
extern const struct rarch_key_map rarch_key_map_android[];
|
2017-01-07 21:34:39 +00:00
|
|
|
extern const struct rarch_key_map rarch_key_map_qnx[];
|
2017-02-05 18:55:19 +00:00
|
|
|
extern const struct rarch_key_map rarch_key_map_dos[];
|
2017-02-09 17:34:12 +00:00
|
|
|
extern const struct rarch_key_map rarch_key_map_wiiu[];
|
2014-10-27 03:27:48 +00:00
|
|
|
|
2015-01-12 01:52:52 +00:00
|
|
|
/**
|
|
|
|
* input_keymaps_init_keyboard_lut:
|
|
|
|
* @map : Keyboard map.
|
|
|
|
*
|
|
|
|
* Initializes and sets the keyboard layout to a keyboard map (@map).
|
|
|
|
**/
|
|
|
|
void input_keymaps_init_keyboard_lut(const struct rarch_key_map *map);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* input_keymaps_translate_keysym_to_rk:
|
|
|
|
* @sym : Key symbol.
|
|
|
|
*
|
|
|
|
* Translates a key symbol from the keyboard layout table
|
|
|
|
* to an associated retro key identifier.
|
|
|
|
*
|
|
|
|
* Returns: Retro key identifier.
|
|
|
|
**/
|
|
|
|
enum retro_key input_keymaps_translate_keysym_to_rk(unsigned sym);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* input_keymaps_translate_rk_to_keysym:
|
|
|
|
* @key : Retro key identifier
|
|
|
|
*
|
|
|
|
* Translates a retro key identifier to a key symbol
|
|
|
|
* from the keyboard layout table.
|
|
|
|
*
|
|
|
|
* Returns: key symbol from the keyboard layout table.
|
|
|
|
**/
|
|
|
|
unsigned input_keymaps_translate_rk_to_keysym(enum retro_key key);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* input_keymaps_translate_rk_to_str:
|
|
|
|
* @key : Retro key identifier.
|
|
|
|
* @buf : Buffer.
|
|
|
|
* @size : Size of @buf.
|
|
|
|
*
|
|
|
|
* Translates a retro key identifier to a human-readable
|
|
|
|
* identifier string.
|
|
|
|
**/
|
|
|
|
void input_keymaps_translate_rk_to_str(enum retro_key key, char *buf, size_t size);
|
2014-10-27 03:27:48 +00:00
|
|
|
|
2016-06-03 03:54:21 +00:00
|
|
|
RETRO_END_DECLS
|
2014-10-27 03:27:48 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|