godotengine / godotengine/godot-docs
Improve InputEvent.device description
- Dominant language
- reStructuredText
- Stars
- 5.7k
- Forks
- 3.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 25
Description
**Your Godot version:**
4.3 (also concerns previous versions)
**Issue description:**
[InputEvent.device](https://docs.godotengine.org/en/latest/classes/class_inputevent.html#class-inputevent-property-device)'s documentation only explains the meaning of its value for mouse and touch events. It could be improved by mentionning its use in other contexts.
Here are my findings, related to joypad events:
- When handling [InputEventJoypadButton](https://docs.godotengine.org/en/latest/classes/class_inputeventjoypadbutton.html) or[InputEventJoypadMotion](https://docs.godotengine.org/en/latest/classes/class_inputeventjoypadmotion.html), its value is an identifier such as the ones expected by methods like [Input.get_joy_name](https://docs.godotengine.org/en/latest/classes/class_input.html#class-input-method-get-joy-name).
- When using [InputMap.action_add_event](https://docs.godotengine.org/en/latest/classes/class_inputmap.html#class-inputmap-method-action-add-event), a value of `-1` means the event may originate from any joypad.
There are probably other behaviors that could be useful to mention, such as whether `-1` when using [InputMap.action_add_event](https://docs.godotengine.org/en/latest/classes/class_inputmap.html#class-inputmap-method-action-add-event) with a mouse or touch event means the event must originate from an emulated click/touch, or may come from any; or whether it will have a different value for multiple mice and keyboards.
**URL to the documentation page:**
[InputEvent.device](https://docs.godotengine.org/en/latest/classes/class_inputevent.html#class-inputevent-property-device)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.