Log Gamepad Info into SessionLog

This commit is contained in:
Florian Märkl 2019-08-06 14:35:53 +02:00
commit db25969efa
No known key found for this signature in database
GPG key ID: 125BC8A5A6A1E857

View file

@ -172,7 +172,7 @@ void StreamSession::UpdateGamepads()
{ {
if(gamepad) if(gamepad)
{ {
qDebug() << "gamepad" << gamepad->deviceId() << "disconnected"; CHIAKI_LOGI(log.GetChiakiLog(), "Gamepad %d disconnected", gamepad->deviceId());
delete gamepad; delete gamepad;
gamepad = nullptr; gamepad = nullptr;
} }
@ -180,7 +180,7 @@ void StreamSession::UpdateGamepads()
if(!connected_pads.isEmpty()) if(!connected_pads.isEmpty())
{ {
gamepad = new QGamepad(connected_pads[0], this); gamepad = new QGamepad(connected_pads[0], this);
qDebug() << "gamepad" << connected_pads[0] << "connected: " << gamepad->name(); CHIAKI_LOGI(log.GetChiakiLog(), "Gamepad %d connected: \"%s\"", connected_pads[0], gamepad->name().toLocal8Bit().constData());
connect(gamepad, &QGamepad::buttonAChanged, this, &StreamSession::SendFeedbackState); connect(gamepad, &QGamepad::buttonAChanged, this, &StreamSession::SendFeedbackState);
connect(gamepad, &QGamepad::buttonBChanged, this, &StreamSession::SendFeedbackState); connect(gamepad, &QGamepad::buttonBChanged, this, &StreamSession::SendFeedbackState);
connect(gamepad, &QGamepad::buttonXChanged, this, &StreamSession::SendFeedbackState); connect(gamepad, &QGamepad::buttonXChanged, this, &StreamSession::SendFeedbackState);