Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input: When a button is quickly pressed and released and the game lags it doesn't get released [Linux] #27104

Closed
santouits opened this issue Mar 15, 2019 · 8 comments · Fixed by #35440

Comments

@santouits
Copy link
Contributor

santouits commented Mar 15, 2019

Godot version:
master

OS/device including version:
Linux 4.19, debian stable

Steps to reproduce:
Update the number in the loop I made inside _process(delta), so that your game lags when you move. Then press an arrow button and release it immediately. If you succeed, the sprite will continue to move and you'll have to press and release again the same button to stop it.

Minimal reproduction project:
project.zip

@MightyPrinny
Copy link
Contributor

the game doesn't have to lag I'm getting this normally when I press a key very very fast

@Calinou
Copy link
Member

Calinou commented Jul 8, 2019

Does this occur if you call Input.set_use_accumulated_input(false) in a script's _ready() function?

@MightyPrinny
Copy link
Contributor

@Calinou that seems to fix the issue thank you.

@Calinou
Copy link
Member

Calinou commented Jul 9, 2019

For the record, accumulated input was enabled by default because of #26395. Maybe accumulated input should only affect mouse input? I'm not sure if this is feasible though.

@akien-mga
Copy link
Member

akien-mga commented Nov 7, 2019

I've seen this in the TPS demo, both in game and in editor (freelook mode), sometimes the movement keys will get stuck going in one direction even when released. I then need to repress and release to stop perpetual movement.

I've seen it both in 3.1 and the current master branch BTW.

@Zireael07
Copy link
Contributor

I saw this getting stuck in my own game when I was beginning working on the sky, and therefore occasionally had very low FPS. 3.1.1.
I was going mad thinking my car input code was to blame!

@starry-abyss
Copy link
Contributor

Maybe related, or maybe I should create an other issue (I use Windows 7):

  • press a key in the Godot game window;
  • focus another window with mouse;
  • release the key;
  • focus the Godot game window;
  • see character still moving as if the key wasn't released.

@Calinou
Copy link
Member

Calinou commented Nov 7, 2019

@starry-abyss You should create another issue for this, as it's not related to input accumulation. To solve this, Godot could be made to release all keys when the window loses focus.

@akien-mga akien-mga changed the title Input: When a button is quickly pressed and released and the game lags it doesn't get released Input: When a button is quickly pressed and released and the game lags it doesn't get released [Linux] Jan 15, 2020
@akien-mga akien-mga modified the milestones: 3.2, 4.0 Jan 22, 2020
@akien-mga akien-mga added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jan 22, 2020
@akien-mga akien-mga modified the milestones: 4.0, 3.2 Jan 22, 2020
@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment