Only print events to stdout when things changed
This commit is contained in:
parent
2a75719cc2
commit
66c39c97d6
1 changed files with 6 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue