Repository: godot
Issue: EditorPlugin mouse position wrong when holding right mouse button
Labels: bug,topic:editor,topic:input

### Godot version

v4.0.beta.custom_build [4828ac6b9]

### System information

Windows 11/64, RTX 3070, Vulkan

### Issue description

Updated Summary:

I'm making an EditorPlugin. When holding the right mouse button in the editor viewport and querying the mouse position, the information provided is wrong. 

This is likely due to the right mouse button capturing the mouse and overriding the mouse position. Both `_forward_3d_gui_input(camera, event): event.position` and `get_viewport().get_mouse_position()` provide the center of the screen. Not the center of the viewport, nor the true position.

**However, the middle mouse button also rotates the camera in the viewport, and it reports the true mouse position accurately.** It also doesn't capture the mouse.

Right mouse button  `_forward_3d_gui_input(camera, event)` and `get_viewport().get_mouse_position()` should mimic the middle mouse button behavior.

------------

This reports incorrect, unchanging values for event.position when the right mouse button is held down (center of the screen). But not any other button, or none.
```
func _forward_3d_gui_input(camera: Camera3D, event: InputEvent) -> int:
	if event is InputEventMouseMotion:
		print("Mouse buttons: %d, pos: %.1v, global_pos: %.1v" % [ event.button_mask, event.position, event.global_position ])
```

eg
```
Mouse buttons: 0, pos: (519.0, 227.0), global_pos: (705.0, 337.0)
Mouse buttons: 0, pos: (519.0, 225.0), global_pos: (705.0, 335.0)
Mouse buttons: 0, pos: (519.0, 224.0), global_pos: (705.0, 334.0)
Mouse buttons: 0, pos: (519.0, 223.0), global_pos: (705.0, 333.0)
Mouse buttons: 0, pos: (519.0, 221.0), global_pos: (705.0, 331.0)
Mouse buttons: 0, pos: (519.0, 219.0), global_pos: (705.0, 329.0)
Mouse buttons: 0, pos: (518.0, 217.0), global_pos: (704.0, 327.0)
Mouse buttons: 0, pos: (517.0, 217.0), global_pos: (703.0, 327.0)
Mouse buttons: 0, pos: (517.0, 216.0), global_pos: (703.0, 326.0)
Mouse buttons: 0, pos: (516.0, 215.0), global_pos: (702.0, 325.0)
Mouse buttons: 2, pos: (774.0, 475.0), global_pos: (960.0, 585.0)
Mouse buttons: 2, pos: (774.0, 475.0), global_pos: (960.0, 585.0)
Mouse buttons: 2, pos: (774.0, 475.0), global_pos: (960.0, 585.0)
Mouse buttons: 2, pos: (774.0, 475.0), global_pos: (960.0, 585.0)
Mouse buttons: 2, pos: (774.0, 475.0), global_pos: (960.0, 585.0)
Mouse buttons: 2, pos: (774.0, 475.0), global_pos: (960.0, 585.0)
Mouse buttons: 2, pos: (774.0, 475.0), global_pos: (960.0, 585.0)
Mouse buttons: 2, pos: (774.0, 475.0), global_pos: (960.0, 585.0)
```

### Steps to reproduce

* Open Node2DGame and run it w/ console.  `_input(event)` Mouse position is reported fine, regardless of button mask
* Open Node3DEditor, switch to the 3D viewport and move the mouse. `_forward_3d_gui_input(event)` Mouse position is fine with no buttons, left or middle buttons, but locks to a strange value if the right button is held down.

Note the right mouse button captures the mouse and rotates the camera. The values become fixed to the screen center.

Middle mouse button also rotates the camera (and shift+mmb pans). The mouse is not captured. The position is reported accurately.

### Minimal reproduction project

[test_mouse_event.zip](https://github.com/godotengine/godot/files/10235732/test_mouse_event.zip)