godotengine / godotengine/godot
_unhandled_key_input's 'event' argument does not have InputEventKey as its type
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
4.3
### System information
Window 11
### Issue description
_unhandled_key_input's event has a type of InputEvent, but shouldn't it use InputEventKey? To get the correct auto-complete, you have to use a workaround like var _event: InputEventKey = event. Unless I am mistaken, event in this method should always be InputEventKey, so there is no reason to use the parent InputEvent instead. event's type cannot otherwise be overridden.
### Steps to reproduce
Use _unhandled_key_input.
### Minimal reproduction project (MRP)
N/A
Contributor guide
Research direction
Start by tracing the _unhandled_key_input entry point and how its event argument is typed in Godot's input API. Verify whether the callback always receives an InputEventKey, then update the exposed type if appropriate and add or run coverage for the callback's type and autocomplete behavior.
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
- 42/100