emscripten: listen for pointerlockchange events on the #document specifically.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 05 Jun 2017 21:30:25 -0400
changeset 11067f4d12a22446e
parent 11066 f39b145db3eb
child 11068 117d4ce1390e
emscripten: listen for pointerlockchange events on the #document specifically.
src/video/emscripten/SDL_emscriptenevents.c
     1.1 --- a/src/video/emscripten/SDL_emscriptenevents.c	Sun Jun 04 23:15:47 2017 +0200
     1.2 +++ b/src/video/emscripten/SDL_emscriptenevents.c	Mon Jun 05 21:30:25 2017 -0400
     1.3 @@ -652,7 +652,7 @@
     1.4      emscripten_set_touchmove_callback("#canvas", data, 0, Emscripten_HandleTouch);
     1.5      emscripten_set_touchcancel_callback("#canvas", data, 0, Emscripten_HandleTouch);
     1.6  
     1.7 -    emscripten_set_pointerlockchange_callback(NULL, data, 0, Emscripten_HandlePointerLockChange);
     1.8 +    emscripten_set_pointerlockchange_callback("#document", data, 0, Emscripten_HandlePointerLockChange);
     1.9  
    1.10      /* Keyboard events are awkward */
    1.11      keyElement = SDL_GetHint(SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT);
    1.12 @@ -693,7 +693,7 @@
    1.13      emscripten_set_touchmove_callback("#canvas", NULL, 0, NULL);
    1.14      emscripten_set_touchcancel_callback("#canvas", NULL, 0, NULL);
    1.15  
    1.16 -    emscripten_set_pointerlockchange_callback(NULL, NULL, 0, NULL);
    1.17 +    emscripten_set_pointerlockchange_callback("#document", NULL, 0, NULL);
    1.18  
    1.19      target = SDL_GetHint(SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT);
    1.20      if (!target) {