mirror of
https://github.com/yawut/SDL.git
synced 2026-08-03 17:05:36 -05:00
Emscripten: Partially fixed not removing key event callbacks if hint was used.
The key event callbacks were always removed from the same target although it is possible to set them to different targets using the hint. This is only a partial fix because it assumes that the hint is not changed to a different value later.
This commit is contained in:
parent
a1b258c0a5
commit
e59e40b840
|
|
@ -621,10 +621,15 @@ Emscripten_UnregisterEventHandlers(SDL_WindowData *data)
|
|||
emscripten_set_touchmove_callback("#canvas", NULL, 0, NULL);
|
||||
emscripten_set_touchcancel_callback("#canvas", NULL, 0, NULL);
|
||||
|
||||
emscripten_set_keydown_callback("#window", NULL, 0, NULL);
|
||||
emscripten_set_keyup_callback("#window", NULL, 0, NULL);
|
||||
const char *target = SDL_GetHint(SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT);
|
||||
if (!target) {
|
||||
target = "#window";
|
||||
}
|
||||
|
||||
emscripten_set_keypress_callback("#window", NULL, 0, NULL);
|
||||
emscripten_set_keydown_callback(target, NULL, 0, NULL);
|
||||
emscripten_set_keyup_callback(target, NULL, 0, NULL);
|
||||
|
||||
emscripten_set_keypress_callback(target, NULL, 0, NULL);
|
||||
|
||||
emscripten_set_fullscreenchange_callback("#document", NULL, 0, NULL);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user