src/InputManager.cpp
//used in an "emergency" where no configs could be loaded from the inputmanager config file
//allows the user to select to reconfigure in menus if this happens without having to delete es_input.cfg manually
used in an "emergency" where no configs could be loaded from the inputmanager config file
allows the user to select to reconfigure in menus if this happens without having to delete es_input.cfg manually
used in an " emergency " where no configs could be loaded from the inputmanager config file allows the user to select to reconfigure in menus if this happens without having to delete es_input . cfg manually
void InputManager::loadDefaultConfig()
{
	InputConfig* cfg = getInputConfigByDevice(DEVICE_KEYBOARD);
	mNumPlayers++;
	cfg->setPlayerNum(0);
	cfg->mapInput("up", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_UP, 1, true));
	cfg->mapInput("down", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_DOWN, 1, true));
	cfg->mapInput("left", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_LEFT, 1, true));
	cfg->mapInput("right", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_RIGHT, 1, true));
	cfg->mapInput("a", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_RETURN, 1, true));
	cfg->mapInput("b", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_ESCAPE, 1, true));
	cfg->mapInput("menu", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_F1, 1, true));
	cfg->mapInput("select", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_F2, 1, true));
	cfg->mapInput("pageup", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_RIGHTBRACKET, 1, true));
	cfg->mapInput("pagedown", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_LEFTBRACKET, 1, true));
	cfg->mapInput("mastervolup", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_PLUS, 1, true));
	cfg->mapInput("mastervoldown", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_MINUS, 1, true));
	cfg->mapInput("sortordernext", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_F7, 1, true));
	cfg->mapInput("sortorderprevious", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_F8, 1, true));
}
void InputManager :: loadDefaultConfig ( ) { InputConfig * cfg = getInputConfigByDevice ( DEVICE_KEYBOARD ) ; mNumPlayers ++ ; cfg -> setPlayerNum ( 0 ) ; cfg -> mapInput ( " " , Input ( DEVICE_KEYBOARD , TYPE_KEY , SDLK_UP , 1 , true ) ) ; cfg -> mapInput ( " " , Input ( DEVICE_KEYBOARD , TYPE_KEY , SDLK_DOWN , 1 , true ) ) ; cfg -> mapInput ( " " , Input ( DEVICE_KEYBOARD , TYPE_KEY , SDLK_LEFT , 1 , true ) ) ; cfg -> mapInput ( " " , Input ( DEVICE_KEYBOARD , TYPE_KEY , SDLK_RIGHT , 1 , true ) ) ; cfg -> mapInput ( " " , Input ( DEVICE_KEYBOARD , TYPE_KEY , SDLK_RETURN , 1 , true ) ) ; cfg -> mapInput ( " " , Input ( DEVICE_KEYBOARD , TYPE_KEY , SDLK_ESCAPE , 1 , true ) ) ; cfg -> mapInput ( " " , Input ( DEVICE_KEYBOARD , TYPE_KEY , SDLK_F1 , 1 , true ) ) ; cfg -> mapInput ( " " , Input ( DEVICE_KEYBOARD , TYPE_KEY , SDLK_F2 , 1 , true ) ) ; cfg -> mapInput ( " " , Input ( DEVICE_KEYBOARD , TYPE_KEY , SDLK_RIGHTBRACKET , 1 , true ) ) ; cfg -> mapInput ( " " , Input ( DEVICE_KEYBOARD , TYPE_KEY , SDLK_LEFTBRACKET , 1 , true ) ) ; cfg -> mapInput ( " " , Input ( DEVICE_KEYBOARD , TYPE_KEY , SDLK_PLUS , 1 , true ) ) ; cfg -> mapInput ( " " , Input ( DEVICE_KEYBOARD , TYPE_KEY , SDLK_MINUS , 1 , true ) ) ; cfg -> mapInput ( " " , Input ( DEVICE_KEYBOARD , TYPE_KEY , SDLK_F7 , 1 , true ) ) ; cfg -> mapInput ( " " , Input ( DEVICE_KEYBOARD , TYPE_KEY , SDLK_F8 , 1 , true ) ) ; }
used in an "emergency" where no configs could be loaded from the inputmanager config file
allows the user to select to reconfigure in menus if this happens without having to delete es_input.cfg manually
used in an " emergency " where no configs could be loaded from the inputmanager config file allows the user to select to reconfigure in menus if this happens without having to delete es_input . cfg manually