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

Pressing tab in InputTextMultiline adds two tabs #1336

Closed
ongamex opened this issue Sep 25, 2017 · 6 comments
Closed

Pressing tab in InputTextMultiline adds two tabs #1336

ongamex opened this issue Sep 25, 2017 · 6 comments
Labels

Comments

@ongamex
Copy link

ongamex commented Sep 25, 2017

Here is my test code:

static char code[1024 * 1024];
ImGui::InputTextMultiline("##source", code, SGE_ARRSZ(code), ImVec2(0,0), ImGuiInputTextFlags_AllowTabInput);

The character is handled twice, and as far as I know this code isn't needed anymore:

else if ((flags & ImGuiInputTextFlags_AllowTabInput) && IsKeyPressedMap(ImGuiKey_Tab) && !io.KeyCtrl && !io.KeyShift && !io.KeyAlt && is_editable) { .... }
@ocornut
Copy link
Owner

ocornut commented Sep 25, 2017

Hello,
I cannot repro the bug here.
I think the reason is that your backend emits both a ImGuiKey_Tab keypress (sets a key within io.KeyDown[] array) and a \t character input with io.AddInputCharacter(). Which backend are you using?

@ongamex
Copy link
Author

ongamex commented Sep 26, 2017

Hmm, this is probably the issue, I'll give it a try in a few hours. Thanks!

PS.
I wrote my own win32/x11 backend.

@ongamex
Copy link
Author

ongamex commented Sep 27, 2017

Yep, that was the case, thanks!

@ocornut
Copy link
Owner

ocornut commented Sep 28, 2017

Taking note. I intend to add an applet that is a sort of "checklist" of imgui integration and that's one interesting case to check.

ocornut added a commit that referenced this issue Apr 3, 2019
…') returns true. (#2467, #1336)

Not using isprint. + todo items.
ocornut added a commit that referenced this issue Apr 3, 2019
…s characters being inserted if the back-end provided both Key and Character input. (#2467, #1336)
ocornut added a commit that referenced this issue Apr 3, 2019
… it. (#1336, #2467)

+ Fix some output filename in SDL build batch files.
ocornut added a commit that referenced this issue Apr 3, 2019
…er the back-end emits both char and keys or just keys. (#2467, #1336)
@ocornut
Copy link
Owner

ocornut commented Apr 3, 2019

Hello @ongamex ,
As it turns out, the problem was maybe elsewhere, see the comments in #2467!

ocornut added a commit that referenced this issue Mar 24, 2022
…1336)

Using Tab keys entirely now, ignoring Tab character. Technically affect who owns the repeat rate.
@ocornut
Copy link
Owner

ocornut commented Mar 24, 2022

This broke recently (on some backend, mostly Win32, SFML, Allegro + trickling input queue).
Fixed by dfbe938

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