From 1fa8e2b0fc1d3926a1770e18d98f9c8f270a3a86 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 29 Jan 2025 16:38:41 +0100 Subject: [PATCH] webgl: Don't use stringToUTF32 for keypress handling --- panda/src/webgldisplay/webGLGraphicsWindow.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/panda/src/webgldisplay/webGLGraphicsWindow.cxx b/panda/src/webgldisplay/webGLGraphicsWindow.cxx index 700f89c1b8..bfb359ac4e 100644 --- a/panda/src/webgldisplay/webGLGraphicsWindow.cxx +++ b/panda/src/webgldisplay/webGLGraphicsWindow.cxx @@ -472,9 +472,9 @@ on_keyboard_event(int type, const EmscriptenKeyboardEvent *event, void *user_dat // it does the right thing. We grab the first unicode code point. // Unfortunately, this doesn't seem to handle dead keys on Firefox. int keycode = 0; - EM_ASM_({ - stringToUTF32(String.fromCharCode($0), $1, 4); - }, event->charCode, &keycode); + keycode = EM_ASM_INT({ + return String.fromCharCode($0).codePointAt(0); + }, event->charCode); if (keycode != 0) { device->keystroke(keycode);