Search Unity

Question Can't ALT-CLICK a Button

Discussion in 'UI Toolkit' started by FuguFirecracker, Aug 21, 2022.

  1. FuguFirecracker

    FuguFirecracker

    Joined:
    Sep 20, 2011
    Posts:
    419
    Title pretty much sez it all, but to make a short story longer ...

    Okay -can't do that- I'll make my own control.
    Hmmm... Pseudostate.Active doesn't work unless I implement Clickable.
    Upon Implementing Clickable, can't Alt-Click.

    o_O

    Any particular reason why one is prevented from Alt-Clicking a button?
     
  2. oscarAbraham

    oscarAbraham

    Joined:
    Jan 7, 2013
    Posts:
    431
    You can do it by adding a ManipulatorActivationFilter to the clickable. That doc page has an example that should work for you; just set the alt modifier in the filter.
     
    FuguFirecracker likes this.
  3. FuguFirecracker

    FuguFirecracker

    Joined:
    Sep 20, 2011
    Posts:
    419
    Thank you for taking the time to let me know about this. :)

    *Edit
    I'll keep this in the back of my mind for later.

    Although the ManipulatorActivationFilter does permit my button to react to whatever input permutations I instruct, there does not appear to be a convenient way to either
    A) Attach more than one MethodHandler to a Clickable
    or B
    ) Attach more than one Clickable to a Button

    Plainly stated, even though my Button will now react to an Alt-Click ... it won't react any differently.

    The only way I can see this of being of any use is by swapping out the buttons || clickables when I send a AltDown Event ..

    But I'm pretty happy with the robust custom control I've already written ;)

    Thanks, again :D
     
    Last edited: Aug 23, 2022