Moved the input debug logging to a more appropriate location.

This also fixes the issue where some input was not being logged correctly.
This commit is contained in:
Leon Styhre 2020-09-15 21:12:32 +02:00
parent 4a13694794
commit a6430ff0ff
5 changed files with 29 additions and 19 deletions

View file

@ -82,6 +82,7 @@ Many bugs have been fixed, and numerous features that were only partially implem
* Hidden files still showed up if they had a gamelist.xml entry
* Fixed an annoying gamelist issue that caused the game images and data to be updated and rendered up to six times every time the list was scrolled
* VRAM statistics overlay was somewhat broken and incorrectly displayed numbers in megabytes instead of mebibytes
* Not all input events were logged when running with debug logging activated
* On Unix, adding a hidden folder with a game in it crashed the application on startup
* If the user tried to enter a blank game name in the metadata editor, the application would crash upon saving
* The SliderComponent knob position was set incorrectly if the minimum value was not zero

View file

@ -1,4 +1,6 @@
// SPDX-License-Identifier: MIT
//
// EmulationStation Desktop Edition
// UIModeController.cpp
//
// Handling of application user interface modes (full, kiosk and kid).
@ -43,9 +45,6 @@ bool UIModeController::listen(InputConfig* config, Input input)
{
// Reads the current input to listen for the passkey sequence to unlock
// the UI mode. The progress is saved in mPassKeyCounter.
if (Settings::getInstance()->getBool("Debug"))
logInput(config, input);
if ((Settings::getInstance()->getString("UIMode") == "full") || !isValidInput(config, input))
return false; // Already unlocked, or invalid input, nothing to do here.
@ -136,20 +135,6 @@ std::string UIModeController::getFormattedPassKeyStr()
return out;
}
void UIModeController::logInput(InputConfig* config, Input input)
{
std::string mapname = "";
std::vector<std::string> maps = config->getMappedTo(input);
for (auto mn : maps) {
mapname += mn;
mapname += ", ";
}
LOG(LogDebug) << "UIModeController::logInput(" << config->getDeviceName() << "): " <<
input.string() << ", isMappedTo=" << mapname << ", value=" << input.value;
}
bool UIModeController::isValidInput(InputConfig* config, Input input)
{
if ((config->getMappedTo(input).size() == 0) || // Not a mapped input, so ignore..

View file

@ -1,11 +1,12 @@
// SPDX-License-Identifier: MIT
//
// EmulationStation Desktop Edition
// UIModeController.h
//
// Handling of application user interface modes (full, kiosk and kid).
// This includes switching the mode when the UI mode passkey is used.
//
#pragma once
#ifndef ES_APP_VIEWS_UI_MODE_CONTROLLER_H
#define ES_APP_VIEWS_UI_MODE_CONTROLLER_H
@ -42,7 +43,6 @@ private:
UIModeController();
bool inputIsMatch(InputConfig * config, Input input);
bool isValidInput(InputConfig * config, Input input);
void logInput(InputConfig * config, Input input);
// Return UI mode to 'full'.
void unlockUIMode();

View file

@ -1,7 +1,10 @@
// SPDX-License-Identifier: MIT
//
// EmulationStation Desktop Edition
// Window.cpp
//
// Window management, screensaver and help prompts.
// The input stack starts here as well, as this is the first instance called by InputManager.
//
#include "Window.h"
@ -132,6 +135,9 @@ void Window::textInput(const char* text)
void Window::input(InputConfig* config, Input input)
{
if (Settings::getInstance()->getBool("Debug"))
logInput(config, input);
if (mScreenSaver) {
if (mScreenSaver->isScreenSaverActive() &&
Settings::getInstance()->getBool("ScreenSaverControls") &&
@ -198,6 +204,20 @@ void Window::input(InputConfig* config, Input input)
}
}
void Window::logInput(InputConfig* config, Input input)
{
std::string mapname = "";
std::vector<std::string> maps = config->getMappedTo(input);
for (auto mn : maps) {
mapname += mn;
mapname += ", ";
}
LOG(LogDebug) << "Window::logInput(" << config->getDeviceName() << "): " <<
input.string() << ", isMappedTo=" << mapname << ", value=" << input.value;
}
void Window::update(int deltaTime)
{
if (mNormalizeNextUpdate) {

View file

@ -1,7 +1,10 @@
// SPDX-License-Identifier: MIT
//
// EmulationStation Desktop Edition
// Window.h
//
// Window management, screensaver and help prompts.
// The input stack starts here as well, as this is the first instance called by InputManager.
//
#ifndef ES_CORE_WINDOW_H
@ -61,6 +64,7 @@ public:
void textInput(const char* text);
void input(InputConfig* config, Input input);
void logInput(InputConfig * config, Input input);
void update(int deltaTime);
void render();