diff --git a/TODO b/TODO index e266508..2b53d97 100644 --- a/TODO +++ b/TODO @@ -78,13 +78,8 @@ Daemon Related Stuff * cleanup device_id, don't manually do (slot<<16) | devid -* need to properly tear down the rumble callback to avoid calling it - before XboxGenericController gets destructed - * get rid of all std::cout stuff, redirect it somewhere else -* unplugging a controller should reset it to neutral position - * improve output on which uinput devices are created * need magic to assign controller to a slot: diff --git a/src/xboxdrv_thread.cpp b/src/xboxdrv_thread.cpp index f1f305b..90b0457 100644 --- a/src/xboxdrv_thread.cpp +++ b/src/xboxdrv_thread.cpp @@ -164,6 +164,15 @@ XboxdrvThread::controller_loop(const Options& opts) // catch read errors from USB and other stuff that can go wrong log_error << err.what() << std::endl; } + + { + // send a event with everything set to zero, so that the input + // device doesn't end up with a non-centered state + XboxGenericMsg msg; + msg.type = XBOX_MSG_XBOX360; + memset(&msg.xbox360, 0, sizeof(msg.xbox360)); + m_processor->send(msg, 0); + } } void