godotengine / godotengine/godot

get_X_mouse_position does not return accurate OS cursor position with tablet pen input.

Open
#112,970 2 comments 0 reactions 0 assignees View on GitHub
bug needs testing topic:input
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Reproducible in 4.5.1-stable, 4.4.1-stable, and 4.6-dev4

### System information

Godot v4.6.dev4 - Windows 11 (build 26100) - Multi-window, 2 monitors - Vulkan (Forward+) - dedicated AMD Radeon RX 6650 XT (Advanced Micro Devices, Inc.; 32.0.21033.3005) - 12th Gen Intel(R) Core(TM) i5-12600KF (16 threads) - 31.82 GiB memory

### Issue description

Using a tablet + pen as an input device, in my case a Wacom Intuos Pro, mouse position functions return inaccurate / lagging behind positions. They appear to update infrequently, usually only updating when the cursor is outside of the game window. Moving a mouse instantly accurately updates the position.

Likely related to https://github.com/godotengine/godot/issues/104659, I was unsure if they were the same exact issue.

InputEventMouseMotion callbacks are still fired consistently even for tablet inputs, so a viable workaround in games is to just set a global mouse position to whatever position was last returned from a mouse motion event.

Video of MRP running, see the console output as I move the tablet pen:

https://github.com/user-attachments/assets/2db60484-2281-4989-904c-00da33afcb7c

### Steps to reproduce

The MRP is just one scene with this function:

```
func _process(_delta: float) -> void:
print(get_global_mouse_position())
```

The editor also breaks down when controlled with a tablet with some buttons being unpressable and unhighlightable.

### Minimal reproduction project (MRP)

[mouse-error-mrp.zip](https://github.com/user-attachments/files/23635104/mouse-error-mrp.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.