<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://freemwiki.com/index.php?action=history&amp;feed=atom&amp;title=Openai%2F69545588-86d8-800f-807e-7602227d6195</id>
	<title>Openai/69545588-86d8-800f-807e-7602227d6195 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://freemwiki.com/index.php?action=history&amp;feed=atom&amp;title=Openai%2F69545588-86d8-800f-807e-7602227d6195"/>
	<link rel="alternate" type="text/html" href="https://freemwiki.com/index.php?title=Openai/69545588-86d8-800f-807e-7602227d6195&amp;action=history"/>
	<updated>2026-05-06T16:01:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>https://freemwiki.com/index.php?title=Openai/69545588-86d8-800f-807e-7602227d6195&amp;diff=595025&amp;oldid=prev</id>
		<title>Lukegao: by freem.ai...</title>
		<link rel="alternate" type="text/html" href="https://freemwiki.com/index.php?title=Openai/69545588-86d8-800f-807e-7602227d6195&amp;diff=595025&amp;oldid=prev"/>
		<updated>2025-12-31T05:24:35Z</updated>

		<summary type="html">&lt;p&gt;by freem.ai...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
{{DISPLAYTITLE:Godot input key issue}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;This conversation was exported from ChatGPT&amp;#039;&amp;#039;&amp;lt;ref&amp;gt;{{cite web|title=Godot input key issue|url=https://chatgpt.com/share/69545588-86d8-800f-807e-7602227d6195|publisher=ChatGPT|access-date=2025-12-31}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== gpt-5-2 ==&lt;br /&gt;
=== User: Holding down any movement key sets framerate on fire. ===&lt;br /&gt;
Holding down any movement key sets framerate on fire.&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
Whenever I hold down WASD or arrow keys (movement buttons), the framerate drops DRAMATICALLY, can go below 1 FPS. I then tried remapping movement to IJKL instead of WASD and somehow using that magically avoided the problem.   &lt;br /&gt;
  &lt;br /&gt;
I&amp;#039;ve searched for every func \_input, \_unhandled\_input and the like. Nowhere I can find the culprit. Debugger profiler doesn&amp;#039;t pinpoint any particular function. Spam-tapping the keys for movement works okay, it&amp;#039;s the holding down input keys that wrecks havoc. Seems it starts mild and then gets stronger the longer the game has been running.   &lt;br /&gt;
&lt;br /&gt;
Any ideas?&lt;br /&gt;
&lt;br /&gt;
=== Assistant: This very strongly smells like a Godot input + UI / key-echo interaction, especially because: ===&lt;br /&gt;
This very strongly smells like a Godot input + UI / key-echo interaction, especially because:&lt;br /&gt;
* WASD + arrow keys cause the problem&lt;br /&gt;
* IJKL does not&lt;br /&gt;
* Tapping is fine, holding is catastrophic&lt;br /&gt;
* Gets worse over time&lt;br /&gt;
* Profiler doesn’t point to a single hot function&lt;br /&gt;
&lt;br /&gt;
Those clues narrow it down a lot.&lt;br /&gt;
&lt;br /&gt;
==== The real culprit (most likely) ====&lt;br /&gt;
&lt;br /&gt;
===== WASD and arrow keys are bound to built-in UI actions =====&lt;br /&gt;
&lt;br /&gt;
By default, Godot maps:&lt;br /&gt;
* ui_left / right / up / down → Arrow keys AND WASD&lt;br /&gt;
&lt;br /&gt;
If you have any Control nodes (UI) in the scene tree — even invisible ones — holding those keys triggers UI navigation every frame, which can:&lt;br /&gt;
* Recalculate focus&lt;br /&gt;
* Traverse the scene tree&lt;br /&gt;
* Fire _gui_input&lt;br /&gt;
* Trigger theme/layout updates&lt;br /&gt;
&lt;br /&gt;
This does NOT show clearly in the profiler, because it’s spread across engine internals.&lt;br /&gt;
&lt;br /&gt;
When you switch to IJKL, those are not bound to UI navigation — problem disappears.&lt;br /&gt;
&lt;br /&gt;
✅ This matches your symptoms perfectly.&lt;br /&gt;
&lt;br /&gt;
==== Why holding makes it worse ====&lt;br /&gt;
&lt;br /&gt;
Holding a key generates echo events:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;gdscript&amp;quot;&amp;gt;InputEventKey (pressed=true, echo=true)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So every frame:&lt;br /&gt;
* _input()&lt;br /&gt;
* _unhandled_input()&lt;br /&gt;
* _gui_input()&lt;br /&gt;
* Focus navigation&lt;br /&gt;
* Any accidental logic tied to input&lt;br /&gt;
&lt;br /&gt;
…keeps firing.&lt;br /&gt;
&lt;br /&gt;
If you accidentally append, spawn, or register anything on key-hold, it snowballs.&lt;br /&gt;
&lt;br /&gt;
==== How to fix it (pick at least one) ====&lt;br /&gt;
&lt;br /&gt;
===== ✅ 1. Unbind WASD from UI actions (RECOMMENDED) =====&lt;br /&gt;
&lt;br /&gt;
Go to:&lt;br /&gt;
&lt;br /&gt;
Project Settings → Input Map&lt;br /&gt;
&lt;br /&gt;
Remove:&lt;br /&gt;
* W, A, S, D&lt;br /&gt;
* Arrow keys (optional)&lt;br /&gt;
&lt;br /&gt;
From:&lt;br /&gt;
* ui_up&lt;br /&gt;
* ui_down&lt;br /&gt;
* ui_left&lt;br /&gt;
* ui_right&lt;br /&gt;
&lt;br /&gt;
Unless you explicitly want keyboard UI navigation.&lt;br /&gt;
&lt;br /&gt;
===== ✅ 2. Ignore key echo events =====&lt;br /&gt;
&lt;br /&gt;
If you use _input(event):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;gdscript&amp;quot;&amp;gt;func _input(event):&lt;br /&gt;
    if event is InputEventKey and event.is_echo():&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This alone fixes many “holding a key destroys FPS” bugs.&lt;br /&gt;
&lt;br /&gt;
===== ✅ 3. Use Input.is_action_pressed() instead of _input =====&lt;br /&gt;
&lt;br /&gt;
For movement, never rely on &amp;lt;code&amp;gt;_input()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Correct pattern:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;gdscript&amp;quot;&amp;gt;func _physics_process(delta):&lt;br /&gt;
    var dir := Vector2.ZERO&lt;br /&gt;
    if Input.is_action_pressed(&amp;quot;move_left&amp;quot;):&lt;br /&gt;
        dir.x -= 1&lt;br /&gt;
    if Input.is_action_pressed(&amp;quot;move_right&amp;quot;):&lt;br /&gt;
        dir.x += 1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This:&lt;br /&gt;
* Avoids echo spam&lt;br /&gt;
* Avoids UI input paths&lt;br /&gt;
* Is deterministic&lt;br /&gt;
&lt;br /&gt;
===== ✅ 4. Make sure movement logic isn’t cumulative =====&lt;br /&gt;
&lt;br /&gt;
Common hidden bug:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;gdscript&amp;quot;&amp;gt;velocity += direction * speed  # BAD&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;gdscript&amp;quot;&amp;gt;velocity = direction * speed   # GOOD&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Holding a key would otherwise accelerate forever, tanking physics.&lt;br /&gt;
&lt;br /&gt;
===== ✅ 5. Check for accidental allocations on input =====&lt;br /&gt;
&lt;br /&gt;
Search for:&lt;br /&gt;
* append&lt;br /&gt;
* add_child&lt;br /&gt;
* connect&lt;br /&gt;
* push_back&lt;br /&gt;
* new()&lt;br /&gt;
&lt;br /&gt;
Anything that runs per input event will explode on key hold.&lt;br /&gt;
&lt;br /&gt;
==== Quick diagnostic test ====&lt;br /&gt;
&lt;br /&gt;
Add this temporarily:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;gdscript&amp;quot;&amp;gt;func _input(event):&lt;br /&gt;
    if event is InputEventKey:&lt;br /&gt;
        print(event.scancode, event.is_echo())&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hold W and watch the flood.&lt;br /&gt;
Hold I and compare.&lt;br /&gt;
&lt;br /&gt;
You’ll see the difference immediately.&lt;br /&gt;
&lt;br /&gt;
==== TL;DR ====&lt;br /&gt;
&lt;br /&gt;
This is almost certainly Godot’s default UI input bindings + key echo.&lt;br /&gt;
&lt;br /&gt;
Unbind WASD from ui_*, ignore echo events, and handle movement via&lt;br /&gt;
Input.is_action_pressed() in _physics_process().&lt;br /&gt;
&lt;br /&gt;
If you want, tell me:&lt;br /&gt;
* Godot version&lt;br /&gt;
* Whether you have any Control nodes in the scene&lt;br /&gt;
* How movement is currently handled&lt;br /&gt;
&lt;br /&gt;
…and I can pinpoint it down to the exact line.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:ChatGPT Shares]]&lt;br /&gt;
[[Category:openai]]&lt;/div&gt;</summary>
		<author><name>Lukegao</name></author>
	</entry>
</feed>