File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -335,6 +335,32 @@ class Screen extends ScreenImpl {
335335 }
336336
337337 private function _onMappedEvent (event : UIEvent ) {
338+ if (_pausedEvents != null && _pausedEvents .indexOf (event .type ) != - 1 ) {
339+ return ;
340+ }
341+
338342 _eventMap .invoke (event .type , event );
339343 }
344+
345+ @:noCompletion private var _pausedEvents : Array <String > = null ;
346+ public function pauseEvent (type : String ) {
347+ if (_pausedEvents == null ) {
348+ _pausedEvents = [];
349+ }
350+ if (_pausedEvents .indexOf (type ) == - 1 ) {
351+ _pausedEvents .push (type );
352+ }
353+ }
354+
355+ public function resumeEvent (type : String , nextFrame : Bool = false ) {
356+ if (nextFrame ) {
357+ Toolkit .callLater (function () {
358+ resumeEvent (type , false );
359+ });
360+ } else {
361+ if (_pausedEvents != null && _pausedEvents .indexOf (type ) != - 1 ) {
362+ _pausedEvents .remove (type );
363+ }
364+ }
365+ }
340366}
You can’t perform that action at this time.
0 commit comments