Only print events to stdout when things changed

This commit is contained in:
Ingo Ruhnke 2011-01-26 16:55:42 +01:00
parent 2a75719cc2
commit 66c39c97d6

View file

@ -130,6 +130,12 @@ XboxdrvThread::controller_loop(const Options& opts)
if (m_controller->read(msg, opts.verbose, m_timeout))
{
m_oldrealmsg = msg;
// output current Xbox gamepad state to stdout
if (!opts.silent)
{
std::cout << msg << std::endl;
}
}
else
{
@ -142,12 +148,6 @@ XboxdrvThread::controller_loop(const Options& opts)
int msec_delta = this_time - last_time;
last_time = this_time;
// output current Xbox gamepad state to stdout
if (!opts.silent)
{ // FIXME: only print stuff on change
std::cout << msg << std::endl;
}
m_processor->send(msg, msec_delta);
if (opts.rumble)