Author Topic: [BUG] UICamere.currentScheme == ControlScheme.Mouse when useMouse == false  (Read 2040 times)

gyd

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 87
    • View Profile
when UICamera.useMouse is false, UICamere.currentScheme will still become ControlScheme.Mouse.

That would make a menu controlled by UIKeyNavigation ( there might be others ) become control-less,
until users press up/down/right/left to let UICamere.currentScheme = ControlScheme.Controller.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: [BUG] UICamere.currentScheme == ControlScheme.Mouse when useMouse == false
« Reply #1 on: December 31, 2016, 07:47:58 AM »
Are you talking about the UICamera.currentScheme's getter when it falls through to the end? You can do this:
  1.                 get
  2.                 {
  3.                         if (mCurrentKey == KeyCode.None) return ControlScheme.Touch;
  4.                         if (mCurrentKey >= KeyCode.JoystickButton0) return ControlScheme.Controller;
  5.                         if (current != null && mLastScheme == ControlScheme.Controller &&
  6.                                 (mCurrentKey == current.submitKey0 || mCurrentKey == current.submitKey1))
  7.                                 return ControlScheme.Controller;
  8.  
  9.                         if (current != null)
  10.                         {
  11.                                 if (current.useMouse) return ControlScheme.Mouse;
  12.                                 if (current.useTouch) return ControlScheme.Touch;
  13.                                 return ControlScheme.Controller;
  14.                         }
  15.                         return ControlScheme.Mouse;
  16.                 }

gyd

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 87
    • View Profile
Re: [BUG] UICamere.currentScheme == ControlScheme.Mouse when useMouse == false
« Reply #2 on: December 31, 2016, 04:08:32 PM »
Yes, that's what i meant.
Just FYI.

Are you talking about the UICamera.currentScheme's getter when it falls through to the end? You can do this:
  1.                 get
  2.                 {
  3.                         if (mCurrentKey == KeyCode.None) return ControlScheme.Touch;
  4.                         if (mCurrentKey >= KeyCode.JoystickButton0) return ControlScheme.Controller;
  5.                         if (current != null && mLastScheme == ControlScheme.Controller &&
  6.                                 (mCurrentKey == current.submitKey0 || mCurrentKey == current.submitKey1))
  7.                                 return ControlScheme.Controller;
  8.  
  9.                         if (current != null)
  10.                         {
  11.                                 if (current.useMouse) return ControlScheme.Mouse;
  12.                                 if (current.useTouch) return ControlScheme.Touch;
  13.                                 return ControlScheme.Controller;
  14.                         }
  15.                         return ControlScheme.Mouse;
  16.                 }