Merge branch 'carbonhell/cursor_grabbed_fix' into 'master'

Fixes mouseinput event ignoring cursor_grabbed being true

See merge request veloren/veloren!895
This commit is contained in:
Monty Marz 2020-04-08 23:03:47 +00:00
commit f90c602c41

View File

@ -509,10 +509,13 @@ impl Window {
}, },
glutin::WindowEvent::ReceivedCharacter(c) => events.push(Event::Char(c)), glutin::WindowEvent::ReceivedCharacter(c) => events.push(Event::Char(c)),
glutin::WindowEvent::MouseInput { button, state, .. } => { glutin::WindowEvent::MouseInput { button, state, .. } => {
if let Some(game_inputs) = Window::map_input( if let (true, Some(game_inputs)) = (
cursor_grabbed,
Window::map_input(
KeyMouse::Mouse(button), KeyMouse::Mouse(button),
controls, controls,
remapping_keybindings, remapping_keybindings,
),
) { ) {
for game_input in game_inputs { for game_input in game_inputs {
events.push(Event::InputUpdate( events.push(Event::InputUpdate(