+ if (!m_processor->CECInitialised() ||
+ !m_processor->IsHandledByLibCEC(command.destination))
+ return CEC_ABORT_REASON_NOT_IN_CORRECT_MODE_TO_RESPOND;
+
+ if (command.parameters.size == 0)
+ return CEC_ABORT_REASON_INVALID_OPERAND;
+
+ CCECBusDevice *device = GetDevice(command.destination);
+ if (!device)
+ return CEC_ABORT_REASON_INVALID_OPERAND;
+
+ CCECClient *client = device->GetClient();
+ if (client)
+ client->AddKey();
+
+ if (command.parameters[0] <= CEC_USER_CONTROL_CODE_MAX)
+ client->SetCurrentButton((cec_user_control_code) command.parameters[0]);
+
+ if (command.parameters[0] == CEC_USER_CONTROL_CODE_POWER ||
+ command.parameters[0] == CEC_USER_CONTROL_CODE_POWER_ON_FUNCTION)