* 重置所有输入状态 * Reset all input state
()
| 483 | * Reset all input state |
| 484 | */ |
| 485 | reset(): void { |
| 486 | this._keyStates.clear(); |
| 487 | this._keysJustPressed.clear(); |
| 488 | this._keysJustReleased.clear(); |
| 489 | |
| 490 | this._mousePosition = { x: 0, y: 0 }; |
| 491 | this._mouseMovement = { x: 0, y: 0 }; |
| 492 | this._scrollDelta = { x: 0, y: 0 }; |
| 493 | this._mouseButtonStates.forEach(state => { |
| 494 | state.pressed = false; |
| 495 | state.justPressed = false; |
| 496 | state.justReleased = false; |
| 497 | }); |
| 498 | this._mouseButtonsJustPressed.clear(); |
| 499 | this._mouseButtonsJustReleased.clear(); |
| 500 | |
| 501 | this._touches.clear(); |
| 502 | this._touchesJustStarted.clear(); |
| 503 | this._touchesJustEnded.clear(); |
| 504 | |
| 505 | this._altKey = false; |
| 506 | this._ctrlKey = false; |
| 507 | this._shiftKey = false; |
| 508 | this._metaKey = false; |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | /** |