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

Change InputText programmatically when pressing a button (keep InputText state and insert character at the cursor position) #5219

Open
mihaibv123 opened this issue Apr 20, 2022 · 0 comments

Comments

@mihaibv123
Copy link

I have a problem with an ImGui::InputText for which I would like to change the text displayed by using a Virtual Keyboard (also created with ImGui). I have a window containing the InputText and another one containing the virtual keyboard (both inside an SDL window).

When I press the buttons on the virtual keyboard I change the buffer I attached to the InputText by adding a character at the end of it. Is there a nicer way to alter the InputText content by taking into account also the position of the cursor inside it and keeping the state of the input text cursor?

I'm a newbie here, sorry if I didn't follow all the guidelines for this question.

ocornut added a commit that referenced this issue Feb 7, 2024
Very highly requested feature (#6962, #5219, #3290, #4627, #5054, #3878, #2881, #1506, #1216, #968).
Also useful for interactive completion/selection popups (#2057, #718)
Based on @kudaba PR. Design for Inputtext V2 should make this obsolete.
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