Skip to content

Commit f32fd6d

Browse files
DutChen18mupfdev
authored andcommitted
emscripten: Fixed unregistering of key event handlers
1 parent 9fd9802 commit f32fd6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/video/emscripten/SDL_emscriptenevents.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1095,11 +1095,11 @@ void Emscripten_UnregisterEventHandlers(SDL_WindowData *data)
10951095
emscripten_set_pointerlockchange_callback(EMSCRIPTEN_EVENT_TARGET_DOCUMENT, NULL, 0, NULL);
10961096

10971097
target = SDL_GetHint(SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT);
1098-
if (!target) {
1098+
if (!target || !*target) {
10991099
target = EMSCRIPTEN_EVENT_TARGET_WINDOW;
11001100
}
11011101

1102-
if (*target) {
1102+
if (SDL_strcmp(target, "#none") != 0) {
11031103
emscripten_set_keydown_callback(target, NULL, 0, NULL);
11041104
emscripten_set_keyup_callback(target, NULL, 0, NULL);
11051105
emscripten_set_keypress_callback(target, NULL, 0, NULL);

0 commit comments

Comments
 (0)