mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
emscripten: listen for pointerlockchange events on the #document specifically.
This commit is contained in:
parent
4b47fa38c3
commit
599d9ba198
@ -652,7 +652,7 @@ Emscripten_RegisterEventHandlers(SDL_WindowData *data)
|
|||||||
emscripten_set_touchmove_callback("#canvas", data, 0, Emscripten_HandleTouch);
|
emscripten_set_touchmove_callback("#canvas", data, 0, Emscripten_HandleTouch);
|
||||||
emscripten_set_touchcancel_callback("#canvas", data, 0, Emscripten_HandleTouch);
|
emscripten_set_touchcancel_callback("#canvas", data, 0, Emscripten_HandleTouch);
|
||||||
|
|
||||||
emscripten_set_pointerlockchange_callback(NULL, data, 0, Emscripten_HandlePointerLockChange);
|
emscripten_set_pointerlockchange_callback("#document", data, 0, Emscripten_HandlePointerLockChange);
|
||||||
|
|
||||||
/* Keyboard events are awkward */
|
/* Keyboard events are awkward */
|
||||||
keyElement = SDL_GetHint(SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT);
|
keyElement = SDL_GetHint(SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT);
|
||||||
@ -693,7 +693,7 @@ Emscripten_UnregisterEventHandlers(SDL_WindowData *data)
|
|||||||
emscripten_set_touchmove_callback("#canvas", NULL, 0, NULL);
|
emscripten_set_touchmove_callback("#canvas", NULL, 0, NULL);
|
||||||
emscripten_set_touchcancel_callback("#canvas", NULL, 0, NULL);
|
emscripten_set_touchcancel_callback("#canvas", NULL, 0, NULL);
|
||||||
|
|
||||||
emscripten_set_pointerlockchange_callback(NULL, NULL, 0, NULL);
|
emscripten_set_pointerlockchange_callback("#document", NULL, 0, NULL);
|
||||||
|
|
||||||
target = SDL_GetHint(SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT);
|
target = SDL_GetHint(SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT);
|
||||||
if (!target) {
|
if (!target) {
|
||||||
|
Loading…
Reference in New Issue
Block a user