From f0b860414785d223596debd4e77640e973179d88 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 6 May 2016 14:51:43 -0400 Subject: [PATCH] Only filter keyboard events to ensure Esc still works when mouse lock is disabled --- main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 9e9e567..bb3934c 100644 --- a/main.cpp +++ b/main.cpp @@ -38,7 +38,12 @@ void MoonlightInstance::OnConnectionStarted(uint32_t unused) { PostMessage(response); // Start receiving input events - RequestInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD | PP_INPUTEVENT_CLASS_MOUSE | PP_INPUTEVENT_CLASS_WHEEL); + RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE | PP_INPUTEVENT_CLASS_WHEEL); + + // Filtering is suboptimal but it ensures that we can pass keyboard events + // to the browser when mouse lock is disabled. This is neccessary for Esc + // to kick the app out of full-screen. + RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD); } void MoonlightInstance::OnConnectionStopped(uint32_t error) {