reset controller to zero when unplugged in XboxdrvDaemon
This commit is contained in:
parent
04c24bd710
commit
9bd6b68d71
2 changed files with 9 additions and 5 deletions
5
TODO
5
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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue