* 解绑平台输入事件 * Unbind platform input events
()
| 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 |
no test coverage detected