Author Topic: UIButtonKeyBinding and UIImageButton.isEnabled  (Read 2887 times)

WebSeed

  • Guest
UIButtonKeyBinding and UIImageButton.isEnabled
« on: October 13, 2013, 03:31:21 AM »
Hi,

I have a UIImageButton with a UIButtonKeyBinding. When I disable the button (isEnabled = false), I can no longer trigger a button press with a mouse / touch event but the key will still trigger the press event (and the sprite changes from disabled to pressed). I guess this is because only the button's collider is disabled. Is this intended behaviour?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIButtonKeyBinding and UIImageButton.isEnabled
« Reply #1 on: October 13, 2013, 10:10:18 AM »
It's because UIButtonKeyBinding doesn't go by UIButton component. It just sends an OnClick message inside (just check the code). If you want it to respect the button's state, you should add code for it. Best place to do it is inside your own function that you have listening for the OnClick event. Check the button state there.