rpgtkoolmv / corescript

http://www.rpgmakerweb.com/products/programs/rpg-maker-mv
MIT License
311 stars 75 forks source link

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

Open Double-X opened 4 years ago

Double-X commented 4 years ago

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