Skip to content

Adds a function to check if a key's just released#212

Open
Double-X wants to merge 1 commit intorpgtkoolmv:masterfrom
Double-X:patch-1
Open

Adds a function to check if a key's just released#212
Double-X wants to merge 1 commit intorpgtkoolmv:masterfrom
Double-X:patch-1

Conversation

@Double-X
Copy link
Copy Markdown

Added this._isReleased = {}; in Input.clear

Added the following in Input.update:
else if (this._previousState[name] && !this._currentState[name]) {
this._isReleased[name] = true;
} else {
this._isReleased[name] = false;
}
Right after:
if (this._currentState[name] && !this._previousState[name]) {
this._latestButton = name;
this._pressedTime = 0;
this._date = Date.now();
}

Added Input.isReleased

Added this._isReleased = {}; in Input.clear

Added the following in Input.update:
else if (this._previousState[name] && !this._currentState[name]) {
    this._isReleased[name] = true;
} else {
    this._isReleased[name] = false;
}
Right after:
if (this._currentState[name] && !this._previousState[name]) {
    this._latestButton = name;
    this._pressedTime = 0;
    this._date = Date.now();
}

Added Input.isReleased
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.

1 participant