-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
Copy & paste using hotkeys produces an extra 'c' or 'v', so as cut, select all. #279
Comments
I suppose it means that GLFW isn't behaving consistently on all OS. On Windows I don't get a character callback when modifiers are pressed. We should be able to add this test in the callback function if we can get the right modifiers at this point in time. Reading io.KeyCtrl etc. is probably good enough but in theory they may data from the previous frame. I have another problem then. Eventually we would need to receive those characters callback and I will need to use them for other features such as pressing ALT+letter to open a menu with the keyboard. |
OK I have just noticed that GLFW has a function glfwSetCharModsCallback() that does just that. So we'll need to use this and make the filtering in imgui code. |
Should be fixed but I couldn't test it on your platform. @AkizukiRyoko can you confirm it is fixed? |
That function was introduced in glfw 3.1 which apparently isn't widespread.. |
@AkizukiRyoko Which version of GLFW are/were you using? |
I have fixed a workaround but please let me know which version of GLFW you had the issue with.! |
It appears that the problem has gone on my platform (glfw 3.0.4). Thank you. |
Using this openFrameworks implementation on OSX still getting c and v instead of copy paste. Not sure it's a mismatch between GLFW implementation of cmd (GLFW_KEY_LEFT_SUPER) and oF or ImGui, but extending the previous fix to include check for is_super_down seems to solve it. glfwGetVersionString 3.1.0 Cocoa NSGL chdir menubar retina
|
I believe this should be fixed at the level of either GLFW or ofxImGui, you can perfectly filter the characters using the same condition. Not knowing if certain IME can emit characters using the Super key isn't safe to filter it for everyone, but if you filter it yourself it may be ok. |
I'm using the latest imgui repository with glfw as fore-end (from opengl_example) under ubuntu 15.04. While I've found that manipulating an InputText with hotkeys will cause some extra characters to appear. For examples:
123456
, press Ctrl+X, the InputText is cleared while123456x
is apparent in cliboard.foobar
is in clipboard, press Ctrl+V when focused on a InputText,vfoobar
will be shown in it.a
.One possible solution I've found it to ignore any inputted character when modifier keys are pressed in ImGui_ImplGlfw_CharCallback.
The text was updated successfully, but these errors were encountered: