Coder Social home page Coder Social logo

Comments (3)

ocornut avatar ocornut commented on May 30, 2024 1

Some users report that the focus gets lost. I am trying to use ImGui::IsItemFocused() to only call SetKeyboardFocusHere when the item is not focused. That didn't work as expected

You should solve this problem because that your actual problem. A repro would be helpful, and building one you may understand the nature of your issue. Right now your statement and claim is too vague for us to be able to help without extra details.
You can use the Dear ImGui Debug Log window it may help you understand what is happening.

(PS: If you steal focus every frame buttons won't work, that's expected behavior.)

from imgui.

ocornut avatar ocornut commented on May 30, 2024 1

In the old UI (this is for Cataclysm: Dark Days Ahead), we were able to draw a text entry field, and without having the focus leave that control, allow users to click buttons with the mouse, then still enter text into the text entry field after the mouse click event without having to click the text field again. I am trying to have some common way in my code to keep that behavior intact.

Emulating precisely this is currently not simple with our current focusing system and we have an issue for it, so if you want to emulate precisely this, I would move the discussion to #1418.

from imgui.

katemonster33 avatar katemonster33 commented on May 30, 2024

Yeah, what you said at the end is basically what I'm getting at with this issue. If I set focus to the InputText every frame that it is unfocused, then buttons will be broken. But at the same time, I feel like my users will complain that the focus ever leaves the input text field.

In the old UI (this is for Cataclysm: Dark Days Ahead), we were able to draw a text entry field, and without having the focus leave that control, allow users to click buttons with the mouse, then still enter text into the text entry field after the mouse click event without having to click the text field again. I am trying to have some common way in my code to keep that behavior intact.

from imgui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.