MCPcopy Create free account
hub / github.com/esengine/esengine / unbindEvents

Method unbindEvents

packages/engine-core/src/Input/InputSystem.ts:163–195  ·  view source on GitHub ↗

* 解绑平台输入事件 * Unbind platform input events

()

Source from the content-addressed store, hash-verified

161 * Unbind platform input events
162 */
163 private unbindEvents(): void {
164 if (!this._inputSubsystem) return;
165
166 const sub = this._inputSubsystem;
167
168 // 键盘事件 | Keyboard events
169 if (sub.offKeyDown) {
170 sub.offKeyDown(this._handleKeyDown);
171 }
172 if (sub.offKeyUp) {
173 sub.offKeyUp(this._handleKeyUp);
174 }
175
176 // 鼠标事件 | Mouse events
177 if (sub.offMouseMove) {
178 sub.offMouseMove(this._handleMouseMove);
179 }
180 if (sub.offMouseDown) {
181 sub.offMouseDown(this._handleMouseDown);
182 }
183 if (sub.offMouseUp) {
184 sub.offMouseUp(this._handleMouseUp);
185 }
186 if (sub.offWheel) {
187 sub.offWheel(this._handleWheel);
188 }
189
190 // 触摸事件 | Touch events
191 sub.offTouchStart(this._handleTouchStart);
192 sub.offTouchMove(this._handleTouchMove);
193 sub.offTouchEnd(this._handleTouchEnd);
194 sub.offTouchCancel(this._handleTouchEnd);
195 }
196
197 // ========== 事件处理函数 | Event handlers ==========
198 // 使用箭头函数保持 this 绑定 | Use arrow functions to preserve this binding

Callers 2

setInputSubsystemMethod · 0.95
onDestroyMethod · 0.95

Calls 10

offKeyDownMethod · 0.65
offKeyUpMethod · 0.65
offMouseMoveMethod · 0.65
offMouseDownMethod · 0.65
offMouseUpMethod · 0.65
offWheelMethod · 0.65
offTouchStartMethod · 0.65
offTouchMoveMethod · 0.65
offTouchEndMethod · 0.65
offTouchCancelMethod · 0.65

Tested by

no test coverage detected