Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLFW: The ctrl or shift key are not detected in secondary viewports #6248

Closed
aiekick opened this issue Mar 15, 2023 · 3 comments
Closed

GLFW: The ctrl or shift key are not detected in secondary viewports #6248

aiekick opened this issue Mar 15, 2023 · 3 comments

Comments

@aiekick
Copy link
Contributor

aiekick commented Mar 15, 2023

Hello,

Version/Branch of Dear ImGui:

Version: 1.89.4
Branch: viewport/docking_

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_Glfw.cpp + imgui_impl_Opengl.cpp
Compiler: Msvc
Operating System: Win10 x64

My Issue/Question:

In my lib ImGuiFileDialog, i have implemented a multi selection for select many files at same time.
in main viewport all is working as expected. but when the dialog is outside so becoming a second viewport,
the Ctrl and shift keys are not catched.

Screenshots/Video

devenv_kKbWzPo45N

After some search i found a fix, so i decided to share it.
btw im not sure if there is not a better and easy fix, or maybe is just a settings im not aware of it :)

in imgui_impl_glfw.cpp
i see than the function ImGui_ImplGlfw_UpdateKeyModifiers is not called for each windows, but just for the main viewport if i understood well.

image

so i modified it like that :

image

and called it like before with the current windows as params in the function ImGui_ImplGlfw_KeyCallback

image

and the result is :

NVIDIA_Share_AcVh3dkqqM

i have not created a pull request because its a very small fix and maybe im wrong, but if you want i can.

Kind Regards

@ocornut ocornut changed the title [Docking] the ctrl or shift key are not detected in other viewports GLFW: The ctrl or shift key are not detected in secondary viewports Mar 16, 2023
@ocornut
Copy link
Owner

ocornut commented Mar 16, 2023

Ouch, this was indeed broken by 1f6e62a (#6034) for multi-viewports It's a shame we don't have a better way to formally test backends
Will push your fix now.

@ocornut
Copy link
Owner

ocornut commented Mar 16, 2023

Fixed with 91577c7
I attributed you the commit
Thanks a lot !

@ocornut ocornut closed this as completed Mar 16, 2023
@aiekick
Copy link
Contributor Author

aiekick commented Mar 16, 2023

Thank you too 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants