Announcement

Collapse
No announcement yet.

Focus 2 widgets at once

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Focus 2 widgets at once

    Hi there,

    Fairly simple problem;

    I have 2 x widgets open at the same time, each with buttons and the sorts inside them.
    Unfortunately the second widget created takes control and I can no longer interact with the first widget.

    What is the reason for this, and can I resolve this?


    #2
    A workaround can be this: when you want to open the 2 widgets at the same time, open a single widget where the second is placed inside the first (https://docs.unrealengine.com/latest...e/#usercreated)

    If you don't find other solutions, try this one

    Comment


      #3
      There are two important concepts to understand in UI systems / Slate. Focus and Capture.

      Focus is where keyboard input goes, and it never makes sense to have more than 1 focus per user of a UI.

      Capture on the other hand is a concept for pointers|fingers|cursors. To allow you to trap the input and prevent other widgets from receiving that input until you're done with it. It's what allows buttons to know when the mouse has been released once it has been pressed in the bounds of the button and released outside of it.

      In Slate, buttons default to being focusable. Focusable elements that lose focus while they have capture, by convention give up their capture as well. The usecase is something like, User 1 presses A to mash a button on the UI, but before releasing presses down to goto the next button, his pressed state/capture state needs to be broken.

      If you need two buttons to both be interactive at the same time, set their focusable state to false in the details panel.

      This catches people a lot on mobile, I've been thinking about making it so the IsFocusable option on buttons is more of a platform specific default.
      Last edited by NickDarnell; 12-15-2016, 05:30 PM.

      Comment


        #4
        Originally posted by Diat Funa View Post
        A workaround can be this: when you want to open the 2 widgets at the same time, open a single widget where the second is placed inside the first (https://docs.unrealengine.com/latest...e/#usercreated)

        If you don't find other solutions, try this one
        As I have absolutely 0 buttons set to focused anywhere, this seems like the go to.

        The only main problem is I had the two widgets separate because unfortunately the retainer box (with a material attached to it) does not respond well to being animated with the canvas panel, hence the reason I had it in a separate widget, I didn't have to worry about incorrect placement of my retainer box effects.

        Comment


          #5
          This was the solution in the end.
          Thanks!

          https://forums.unrealengine.com/show...ner-box-error)

          Comment

          Working...
          X