@@ -51,10 +51,6 @@ var LibraryHTML5 = {
5151 currentEventHandler: null,
5252#endif
5353*/
54- memcpy ( target , src , size ) {
55- HEAP8 . set ( HEAP8 . subarray ( src , src + size ) , target ) ;
56- } ,
57-
5854 removeAllEventListeners ( ) {
5955 while ( JSEvents . eventHandlers . length ) {
6056 JSEvents . _removeHandler ( JSEvents . eventHandlers . length - 1 ) ;
@@ -551,16 +547,14 @@ var LibraryHTML5 = {
551547 emscripten_set_mouseout_callback_on_thread : ( target , userData , useCapture , callbackfunc , targetThread ) =>
552548 registerMouseEventCallback ( target , userData , useCapture , callbackfunc , { { { cDefs . EMSCRIPTEN_EVENT_MOUSEOUT } } } , "mouseout" , targetThread) ,
553549
554- emscripten_get_mouse_status__proxy : 'sync' ,
555- emscripten_get_mouse_status__deps : [ '$JSEvents' ] ,
556- emscripten_get_mouse_status : ( mouseState ) => {
557- if ( ! JSEvents . mouseEvent ) return { { { cDefs . EMSCRIPTEN_RESULT_NO_DATA } } } ;
558- // HTML5 does not really have a polling API for mouse events, so implement one manually by
559- // returning the data from the most recently received event. This requires that user has registered
560- // at least some no-op function as an event handler to any of the mouse function.
561- JSEvents . memcpy ( mouseState , JSEvents . mouseEvent , { { { C_STRUCTS . EmscriptenMouseEvent . __size__ } } } ) ;
562- return { { { cDefs . EMSCRIPTEN_RESULT_SUCCESS } } } ;
563- } ,
550+ // HTML5 does not really have a polling API for mouse events, so implement one
551+ // manually by returning the data from the most recently received event. This
552+ // requires that user has registered at least some no-op function as an event
553+ // handler to any of the mouse function.
554+ _emscripten_get_last_mouse_event__proxy : 'sync' ,
555+ _emscripten_get_last_mouse_event__internal : true ,
556+ _emscripten_get_last_mouse_event__deps : [ '$JSEvents' ] ,
557+ _emscripten_get_last_mouse_event : ( ) => JSEvents . mouseEvent ,
564558
565559 $registerWheelEventCallback__noleakcheck : true ,
566560 $registerWheelEventCallback__deps : [ '$JSEvents' , '$fillMouseEventData' , 'malloc' ] ,
@@ -778,16 +772,14 @@ var LibraryHTML5 = {
778772 return registerDeviceOrientationEventCallback ( { { { cDefs . EMSCRIPTEN_EVENT_TARGET_WINDOW } } } , userData , useCapture, callbackfunc, { { { cDefs . EMSCRIPTEN_EVENT_DEVICEORIENTATION } } } , "deviceorientation" , targetThread) ;
779773 } ,
780774
781- emscripten_get_deviceorientation_status__proxy : 'sync' ,
782- emscripten_get_deviceorientation_status__deps : [ '$JSEvents' ] ,
783- emscripten_get_deviceorientation_status : ( orientationState ) => {
784- if ( ! JSEvents . deviceOrientationEvent ) return { { { cDefs . EMSCRIPTEN_RESULT_NO_DATA } } } ;
785- // HTML5 does not really have a polling API for device orientation events, so implement one manually by
786- // returning the data from the most recently received event. This requires that user has registered
787- // at least some no-op function as an event handler.
788- JSEvents . memcpy ( orientationState , JSEvents . deviceOrientationEvent , { { { C_STRUCTS . EmscriptenDeviceOrientationEvent . __size__ } } } ) ;
789- return { { { cDefs . EMSCRIPTEN_RESULT_SUCCESS } } } ;
790- } ,
775+ // HTML5 does not really have a polling API for device orientation events, so
776+ // implement one manually by returning the data from the most recently
777+ // received event. This requires that user has registered at least some
778+ // no-op function as an event handler.
779+ _emscripten_get_last_deviceorientation_event__proxy : 'sync' ,
780+ _emscripten_get_last_deviceorientation_event__internal : true ,
781+ _emscripten_get_last_deviceorientation_event__deps : [ '$JSEvents' ] ,
782+ _emscripten_get_last_deviceorientation_event : ( ) => JSEvents . deviceOrientationEvent ,
791783
792784 $fillDeviceMotionEventData : ( eventStruct , e , target ) => {
793785 var supportedFields = 0 ;
@@ -847,16 +839,14 @@ var LibraryHTML5 = {
847839 emscripten_set_devicemotion_callback_on_thread : ( userData , useCapture , callbackfunc , targetThread ) =>
848840 registerDeviceMotionEventCallback ( { { { cDefs . EMSCRIPTEN_EVENT_TARGET_WINDOW } } } , userData, useCapture, callbackfunc, { { { cDefs . EMSCRIPTEN_EVENT_DEVICEMOTION } } } , "devicemotion" , targetThread) ,
849841
850- emscripten_get_devicemotion_status__proxy : 'sync' ,
851- emscripten_get_devicemotion_status__deps : [ '$JSEvents' ] ,
852- emscripten_get_devicemotion_status : ( motionState ) => {
853- if ( ! JSEvents . deviceMotionEvent ) return { { { cDefs . EMSCRIPTEN_RESULT_NO_DATA } } } ;
854- // HTML5 does not really have a polling API for device motion events, so implement one manually by
855- // returning the data from the most recently received event. This requires that user has registered
856- // at least some no-op function as an event handler.
857- JSEvents . memcpy ( motionState , JSEvents . deviceMotionEvent , { { { C_STRUCTS . EmscriptenDeviceMotionEvent . __size__ } } } ) ;
858- return { { { cDefs . EMSCRIPTEN_RESULT_SUCCESS } } } ;
859- } ,
842+ // HTML5 does not really have a polling API for device motion events, so
843+ // implement one manually by returning the data from the most recently
844+ // received event. This requires that user has registered at least some
845+ // no-op function as an event handler.
846+ _emscripten_get_last_devicemotion_event__proxy : 'sync' ,
847+ _emscripten_get_last_devicemotion_event__internal : true ,
848+ _emscripten_get_last_devicemotion_event__deps : [ '$JSEvents' ] ,
849+ _emscripten_get_last_devicemotion_event : ( ) => JSEvents . deviceMotionEvent ,
860850
861851 $screenOrientation : ( ) => {
862852 if ( ! window . screen ) return undefined ;
0 commit comments