godotengine / godotengine/godot
Input.is_mouse_button_pressed(MOUSE_BUTTON_WHEEL_LEFT/RIGHT) is always returning false
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- Reproducable in v4.2.2.stable.official [15073afe3]
### System information
Godot v4.2.2.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2080 Ti (NVIDIA; 31.0.15.3623) - AMD Ryzen 9 3900X 12-Core Processor (24 Threads)
### Issue description
The function `is_mouse_button_pressed()` works with mouse indices like 1 for left mouse button, it does not for 6 or 7 which are wheel left and right:
```gdscript
Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT) # Returns true if pressed, false if not
Input.is_mouse_button_pressed(MOUSE_BUTTON_WHEEL_LEFT) # Always returns false
```
### Steps to reproduce
```gdscript
func _process(delta):
print(Input.is_mouse_button_pressed(MOUSE_BUTTON_WHEEL_LEFT))
```
Run and press your mouse wheel to the left.
### Minimal reproduction project (MRP)
[BugReport.zip](https://github.com/godotengine/godot/files/15066884/BugReport.zip)
Contributor guide
Research direction
Start with the minimal reproduction project BugReport.zip and its _process entry point, then run it while pressing the wheel left or right. Trace Godot's input handling for MOUSE_BUTTON_WHEEL_LEFT and MOUSE_BUTTON_WHEEL_RIGHT; done means is_mouse_button_pressed() reports the wheel directions correctly instead of always returning false.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- godot
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100