@@ -8,7 +8,6 @@ import { IBufferService, IMouseStateService, ICoreService, ILogService, IOptions
88import { CoreMouseAction , CoreMouseButton , CoreMouseEventType , IDisposable } from 'common/Types' ;
99import { C0 } from 'common/data/EscapeSequences' ;
1010import { toDisposable } from 'common/Lifecycle' ;
11- import { CustomWheelEventHandler } from 'browser/Types' ;
1211import { ICoreBrowserService , IMouseCoordsService , IMouseService , IMouseServiceTarget , IRenderService , ISelectionService } from './Services' ;
1312
1413type RequestedMouseEvents = Record < 'mouseup' | 'wheel' | 'mousedrag' | 'mousemove' , EventListener | null > ;
@@ -22,8 +21,6 @@ interface IMouseBindContext {
2221export class MouseService implements IMouseService {
2322 public serviceBrand : undefined ;
2423
25- private _customWheelEventHandler : CustomWheelEventHandler | undefined ;
26-
2724 constructor (
2825 @IRenderService private readonly _renderService : IRenderService ,
2926 @IMouseCoordsService private readonly _mouseCoordsService : IMouseCoordsService ,
@@ -119,7 +116,7 @@ export class MouseService implements IMouseService {
119116 but = ev . button < 3 ? ev . button : CoreMouseButton . NONE ;
120117 break ;
121118 case 'wheel' :
122- if ( this . _customWheelEventHandler && this . _customWheelEventHandler ( ev as WheelEvent ) === false ) {
119+ if ( ! this . _mouseStateService . allowCustomWheelEvent ( ev as WheelEvent ) ) {
123120 return false ;
124121 }
125122 const deltaY = ( ev as WheelEvent ) . deltaY ;
@@ -226,7 +223,7 @@ export class MouseService implements IMouseService {
226223 return ;
227224 }
228225
229- if ( this . _customWheelEventHandler && this . _customWheelEventHandler ( ev ) === false ) {
226+ if ( ! this . _mouseStateService . allowCustomWheelEvent ( ev ) ) {
230227 return false ;
231228 }
232229
@@ -320,7 +317,4 @@ export class MouseService implements IMouseService {
320317 }
321318 }
322319
323- public setCustomWheelEventHandler ( customWheelEventHandler : CustomWheelEventHandler | undefined ) : void {
324- this . _customWheelEventHandler = customWheelEventHandler ;
325- }
326320}
0 commit comments