void NaClApplication::setMouseLocked(bool enabled) { /* Already done, nothing to do */ if(enabled == isMouseLocked()) return; if(enabled) LockMouse(pp::CompletionCallback(&mouseLockCallback, this)); else UnlockMouse(); }
void MoonlightInstance::OnConnectionStopped(uint32_t error) { // Not running anymore m_Running = false; // Stop receiving input events ClearInputEventRequest(PP_INPUTEVENT_CLASS_MOUSE | PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_KEYBOARD); // Unlock the mouse UnlockMouse(); // Notify the JS code that the stream has ended pp::Var response(MSG_STREAM_TERMINATED); PostMessage(response); }