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

Issue using io.ClearInputCharacters() #2425

Closed
ShermIO opened this issue Mar 16, 2019 · 1 comment
Closed

Issue using io.ClearInputCharacters() #2425

ShermIO opened this issue Mar 16, 2019 · 1 comment
Labels

Comments

@ShermIO
Copy link

ShermIO commented Mar 16, 2019

Version/Branch of Dear ImGui:

Version: 1.67
Branch: master

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_dx11.cpp
Compiler: Visual Studio Community 2017
Operating System: Windows 10 (Ver 1809)

My Issue/Question:

Hello! I am having issues using io.ClearInputCharacters(). I can use io.AddInputCharactersUTF8("sample character") just fine. I use the following code to add input characters: https://pastebin.com/WYXT6tEK

However, when I try to clear the input characters, nothing simply happens. I am using the following code to clear input characters and added a simple cout to ensure that I am getting detecting the press of backspace just fine. https://pastebin.com/GhSK9zej

Any help or thoughts is much appreciated. I am sure the issue is probably me doing something wrong, however, in the chance that it is an issue with ImGui, I wanted to make you guys aware. Thanks!

@ocornut
Copy link
Owner

ocornut commented Mar 16, 2019

InputCharacters is a character queue that is processed and consumed every frame, there’s almost never a reason to clear it and you certainly shouldn’t clear it In relation to the backspace key. You are misunderstanding its purpose.

Refer to imgui_impl_win32.cpp about how to use AddInputCharacter() functions via the WM_CHAR message.

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

No branches or pull requests

2 participants