summaryrefslogtreecommitdiff
Commit message (Expand)AuthorAge
* State at 2023-10-12autocommitter2024-04-22
* State at 2023-04-13autocommitter2024-04-22
* State at 2023-04-11autocommitter2024-04-22
* State at 2023-03-26autocommitter2024-04-22
* State at 2022-06-27autocommitter2024-04-22
* State at 2022-01-01autocommitter2024-04-22
* State at 2021-12-16autocommitter2024-04-22
* State at 2021-12-15autocommitter2024-04-22
* State at 2021-12-07autocommitter2024-04-22
* State at 2021-10-19autocommitter2024-04-22
* State at 2021-10-06autocommitter2024-04-22
* State at 2021-10-01autocommitter2024-04-22
* State at 2021-06-19autocommitter2024-04-22
* State at 2021-06-08autocommitter2024-04-22
* State at 2021-05-31autocommitter2024-04-22
* State at 2021-05-30autocommitter2024-04-22
* State at 2021-05-14autocommitter2024-04-22
* State at 2021-05-03autocommitter2024-04-22
* State at 2021-04-28autocommitter2024-04-22
* State at 2021-04-19autocommitter2024-04-22
* State at 2021-04-11autocommitter2024-04-22
* State at 2021-04-06autocommitter2024-04-22
* State at 2021-04-05autocommitter2024-04-22
* State at 2021-04-04autocommitter2024-04-22
* State at 2020-12-14autocommitter2024-04-22
* State at 2020-11-06autocommitter2024-04-22
* State at 2020-09-28autocommitter2024-04-22
* State at 2020-08-29autocommitter2024-04-22
* State at 2020-06-24autocommitter2024-04-22
* State at 2020-04-06autocommitter2024-04-22
* State at 2020-02-17autocommitter2024-04-22
* State at 2019-12-13autocommitter2024-04-22
a> 226 227 228 229 230 231 232 233 234
/*
 Minetest-c55
 Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>

 This program 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 Foundation; either version 2 of the License, or
 (at your option) any later version.

 This program 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 this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#include "keycode.h"
#include "main.h" // For g_settings
#define CHECKKEY(x){if(strcmp(name, #x)==0) return irr::x;}

irr::EKEY_CODE keyname_to_keycode(const char *name)
{
	CHECKKEY(KEY_LBUTTON)
	CHECKKEY(KEY_RBUTTON)
	CHECKKEY(KEY_CANCEL)
	CHECKKEY(KEY_MBUTTON)
	CHECKKEY(KEY_XBUTTON1)
	CHECKKEY(KEY_XBUTTON2)
	CHECKKEY(KEY_BACK)
	CHECKKEY(KEY_TAB)
	CHECKKEY(KEY_CLEAR)
	CHECKKEY(KEY_RETURN)
	CHECKKEY(KEY_SHIFT)
	CHECKKEY(KEY_CONTROL)
	CHECKKEY(KEY_MENU)
	CHECKKEY(KEY_PAUSE)
	CHECKKEY(KEY_CAPITAL)
	CHECKKEY(KEY_KANA)
	CHECKKEY(KEY_HANGUEL)
	CHECKKEY(KEY_HANGUL)
	CHECKKEY(KEY_JUNJA)
	CHECKKEY(KEY_FINAL)
	CHECKKEY(KEY_HANJA)
	CHECKKEY(KEY_KANJI)
	CHECKKEY(KEY_ESCAPE)
	CHECKKEY(KEY_CONVERT)
	CHECKKEY(KEY_NONCONVERT)
	CHECKKEY(KEY_ACCEPT)
	CHECKKEY(KEY_MODECHANGE)
	CHECKKEY(KEY_SPACE)
	CHECKKEY(KEY_PRIOR)
	CHECKKEY(KEY_NEXT)
	CHECKKEY(KEY_END)
	CHECKKEY(KEY_HOME)
	CHECKKEY(KEY_LEFT)
	CHECKKEY(KEY_UP)
	CHECKKEY(KEY_RIGHT)
	CHECKKEY(KEY_DOWN)
	CHECKKEY(KEY_SELECT)
	CHECKKEY(KEY_PRINT)
	CHECKKEY(KEY_EXECUT)
	CHECKKEY(KEY_SNAPSHOT)
	CHECKKEY(KEY_INSERT)
	CHECKKEY(KEY_DELETE)
	CHECKKEY(KEY_HELP)
	CHECKKEY(KEY_KEY_0)
	CHECKKEY(KEY_KEY_1)
	CHECKKEY(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