From fe1a0ca2fbf0aeaf07b14aec9a9bd74a2005e1a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 3 Jul 2022 12:00:26 +0200 Subject: [PATCH] Input: Document that accumulated input is disabled by default This was actually disabled by mistake in 3.4 causing a regression, but since this issue survived the whole 3.4.x series and it's now very close to 3.5, it's too late to change it again. We might consider it for 3.6 after some beta testing. Fixes #55037. --- doc/classes/Input.xml | 1 + doc/classes/InputEventMouseMotion.xml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index 39d525c1b19b..e3580025a01a 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -400,6 +400,7 @@ If [code]true[/code], similar input events sent by the operating system are accumulated. When input accumulation is enabled, all input events generated during a frame will be merged and emitted when the frame is done rendering. Therefore, this limits the number of input method calls per second to the rendering FPS. Input accumulation can be disabled to get slightly more precise/reactive input at the cost of increased CPU usage. In applications where drawing freehand lines is required, input accumulation should generally be disabled while the user is drawing the line to get results that closely follow the actual input. + [b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward compatibility reasons. It is however recommended to enable it for games which don't require very reactive input, as this will decrease CPU usage. diff --git a/doc/classes/InputEventMouseMotion.xml b/doc/classes/InputEventMouseMotion.xml index 84e2ea24f55c..93ddf4343a11 100644 --- a/doc/classes/InputEventMouseMotion.xml +++ b/doc/classes/InputEventMouseMotion.xml @@ -5,7 +5,8 @@ Contains mouse and pen motion information. Supports relative, absolute positions and speed. See [method Node._input]. - [b]Note:[/b] By default, this event is only emitted once per frame rendered at most. If you need more precise input reporting, set [member Input.use_accumulated_input] to [code]false[/code] to make events emitted as often as possible. If you use InputEventMouseMotion to draw lines, consider implementing [url=https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to avoid visible gaps in lines if the user is moving the mouse quickly. + [b]Note:[/b] By default, this event can be emitted multiple times per frame rendered, allowing for precise input reporting, at the expense of CPU usage. You can set [member Input.use_accumulated_input] to [code]true[/code] to let multiple events merge into a single emitted event per frame. + [b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider implementing [url=https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to avoid visible gaps in lines if the user is moving the mouse quickly. $DOCS_URL/tutorials/inputs/mouse_and_input_coordinates.html