From 20ec77eeb0b2dcbeb2b6e1595e7c0b9b175e7cb9 Mon Sep 17 00:00:00 2001 From: Carbonhell Date: Wed, 8 Apr 2020 23:46:42 +0200 Subject: [PATCH] Fixes mouseinput event ignoring cursor_grabbed being true --- voxygen/src/window.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/voxygen/src/window.rs b/voxygen/src/window.rs index 9b80288f37..7229f007d0 100644 --- a/voxygen/src/window.rs +++ b/voxygen/src/window.rs @@ -509,10 +509,13 @@ impl Window { }, glutin::WindowEvent::ReceivedCharacter(c) => events.push(Event::Char(c)), glutin::WindowEvent::MouseInput { button, state, .. } => { - if let Some(game_inputs) = Window::map_input( - KeyMouse::Mouse(button), - controls, - remapping_keybindings, + if let (true, Some(game_inputs)) = ( + cursor_grabbed, + Window::map_input( + KeyMouse::Mouse(button), + controls, + remapping_keybindings, + ), ) { for game_input in game_inputs { events.push(Event::InputUpdate(