You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a simple wordwrap for InputTextMultiline for use with monospace fonts and so far "most" things are going well except for when I start backspacing across prior linebreaks ( this is due to the codec being used creating \r\n instances to represent hard-breaks, so backspacing then produces a sole \r ).
My question is, where/how can I capture the backspace keypress and is it available within the callback so that I can properly test for and handle this corner case?
While I can see the callback being invoked during with the backspace press if I have the ImGuiInputTextFlags_CallbackEdit, I however cannot see where I can detect if it was the backspace key that induced that, neither data->EventKey or data->EventChar indicate anything for me.
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
No response
The text was updated successfully, but these errors were encountered:
We cannot provide the info in EventKey for ImGuiInputTextFlags_CallbackEdit as multiple edits may have happened.
You could technically simply poll the key on that event, but the edit will have been done already, and it feels a bit like a quagmire to think you can reliably reconstruct a sequence of event and patch a text buffer this way.
Generally speaking, I'm not super comfortable moving forward with this that as:
word-wrapping is not yet supported and I don't think pre-wrapping the string is a good solution, proper support would be better.
ideally I would phase out as many inputtext callbacks in favor of using input routing check + making it easier to externally access and edit input text contents.
So adding another layer of complexity into existing callbacks in order to facilitate developing a workaround for a feature seems like a patch over a patch. But if you can think of something simple I can do I'll try to help.
I appreciate the candid response. I agree a proper WW solution within InputTextMultiline would be the most ideal solution though I know you've got your plate more than full with everything else you're handling, so I'm taking this path as a "bodge" solution until such time that it arrives in native form.
I'll ponder on my options a little more and report back. Thank you again for your time.
Version/Branch of Dear ImGui:
1.91.9
Back-ends:
SDL2 software
Compiler, OS:
linux + gcc
Full config/build information:
No response
Details:
I'm working on a simple wordwrap for InputTextMultiline for use with monospace fonts and so far "most" things are going well except for when I start backspacing across prior linebreaks ( this is due to the codec being used creating \r\n instances to represent hard-breaks, so backspacing then produces a sole \r ).
My question is, where/how can I capture the backspace keypress and is it available within the callback so that I can properly test for and handle this corner case?
While I can see the callback being invoked during with the backspace press if I have the ImGuiInputTextFlags_CallbackEdit, I however cannot see where I can detect if it was the backspace key that induced that, neither data->EventKey or data->EventChar indicate anything for me.
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
No response
The text was updated successfully, but these errors were encountered: