Open ypujante opened 4 months ago
I believe the issue, in both instances, is linked to this javascript problem.
Although it is not an ImGui bug per se, but more an issue in the underlying implementations/platform, I just wanted to file this bug here in case other people run into this issue and know that there is, at the moment, an issue when using ImGui in the browser... In the end, it does break ImGui since the state of keys maintained by ImGui becomes out of whack with reality which can then lead to other issues...
I am going to investigate if there is a workaround I can implement in emscripten-glfw at the minimum since I am in control of this library... I am going to report it to emscripten as well...
The issue was actually reported for the built-in/embedded implementation of GLFW3 back on 10/2022 (and never addressed for what I can tell)
I have now implemented a workaround for emscripten-glfw and issued a PR to be merged.
Another issue in this case, is that io.ConfigMacOSXBehaviors
is not set.
It would need to be set on a Mac to invert Super and Ctrl and handle behaviors such as Ctrl+LeftClick turned into RightClick.
Normally we do this:
#ifdef __APPLE__
ConfigMacOSXBehaviors = true; // Set Mac OS X style defaults based on __APPLE__ compile time flag
#else
ConfigMacOSXBehaviors = false;
#endif
But of course this doesn't run on Emscripten. So we need a way to detect a Mac user on Emscripten.
Version/Branch of Dear ImGui:
master
Back-ends:
example_sdl2_opengl3 / example_glfw_wgpu
Compiler, OS:
emscripten / browser
Full config/build information:
Details:
I uncovered this issue while working on a separate project tied to the PR
Screenshots/Video:
Minimal, Complete and Verifiable Example code:
Using fresh imgui clone
Under
examples/example_sdl2_opengl3
Under
examples/example_glfw_wgpu
In both builds (using sdl2 as the backend or glfw as the backend),
"LeftSuper" 530 "ModSuper" 665
"LeftSuper" 530 "V" 567 "ModSuper" 665
"LeftSuper" 530 "V" 567 "ModSuper" 665
(this is wrong)"V" 567
(this is wrong)