Added command line option for keyboard debugging.

This commit is contained in:
hiker 2015-01-08 09:05:04 +11:00
parent 474012c442
commit 1eb51db5ea
3 changed files with 13 additions and 1 deletions

View File

@ -478,6 +478,9 @@ namespace UserConfigParams
/** If gamepad debugging is enabled. */
PARAM_PREFIX bool m_gamepad_debug PARAM_DEFAULT( false );
/** If gamepad debugging is enabled. */
PARAM_PREFIX bool m_keyboard_debug PARAM_DEFAULT(false);
/** Wiimote debugging. */
PARAM_PREFIX bool m_wiimote_debug PARAM_DEFAULT( false );

View File

@ -181,6 +181,13 @@ bool EventHandler::OnEvent (const SEvent &event)
World::getWorld()->onMouseClick(event.MouseInput.X, event.MouseInput.Y);
}
if (UserConfigParams::m_keyboard_debug)
{
Log::verbose("keyboard", "char %d key %d ctrl %d down %d shift %d",
event.KeyInput.Char, event.KeyInput.Key,
event.KeyInput.Control, event.KeyInput.PressedDown,
event.KeyInput.Shift);
}
// FIXME? it may be a bit unclean that all input events go trough
// the gui module
const EventPropagation blockPropagation = input_manager->input(event);

View File

@ -659,7 +659,9 @@ int handleCmdLine()
if(CommandLine::has("--gamepad-debug"))
UserConfigParams::m_gamepad_debug=true;
if(CommandLine::has("--wiimote-debug"))
if (CommandLine::has("--keyboard-debug"))
UserConfigParams::m_keyboard_debug = true;
if (CommandLine::has("--wiimote-debug"))
UserConfigParams::m_wiimote_debug = true;
if(CommandLine::has("--tutorial-debug"))
UserConfigParams::m_tutorial_debug = true;