Skip to content

InputFix#21

Open
HEIHUAa wants to merge 1 commit intoCodenameCrew:devfrom
HEIHUAa:InputFix
Open

InputFix#21
HEIHUAa wants to merge 1 commit intoCodenameCrew:devfrom
HEIHUAa:InputFix

Conversation

@HEIHUAa
Copy link

@HEIHUAa HEIHUAa commented Feb 22, 2026

This fix resolves an issue where __justPressed and __justReleased could fail at extremely high frame rates. In CNE, this issue manifested as sometimes being unable to hit regular notes.

Copy link

@moxie-coder moxie-coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what was the logic behind this

Image

@HEIHUAa
Copy link
Author

HEIHUAa commented Feb 22, 2026

what was the logic behind this

Image

It's simple: FlxG.game.ticks only has millisecond precision. If the frame interval is less than one millisecond, FlxG.game.ticks will remain the same as the previous frame, resulting in missed input detection for that frame.
My modification ensures that the detection truly checks once per frame refresh.

moxie-coder added a commit to JS-Engine-things/flixel-JS-Engine that referenced this pull request Feb 22, 2026
@ItsLJcool
Copy link

chat did we forget about the >= operation

@HEIHUAa
Copy link
Author

HEIHUAa commented Feb 22, 2026

chat did we forget about the >= operation

I'm not sure I follow, what do you mean?

@ItsLJcool
Copy link

oh wait I see what this change does, weird why they used the game ticks for this check it makes no sense

Basically it's supposed to not run more than once so if the function is called during an update function and it's already doing the checks it will not check again because inputs can be checked more than once if you spam, and doing so can cause lag spikes, so if you are lagging, this should do what It was supposed to do

swordcube pushed a commit to swordcubes-grave-of-shite/flixel that referenced this pull request Feb 22, 2026
was taken from this pr to codename engine's flixel fork:
CodenameCrew#21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants