yasirkula / UnityRuntimeInspector

Runtime Inspector and Hierarchy solution for Unity for debugging and runtime editing purposes
MIT License
1.68k stars 135 forks source link

Keyboard navigation #5

Closed bleppie closed 4 years ago

bleppie commented 5 years ago

Hi, fantastic Unity asset!

I would like be able to navigate around the Inspector and Hierarchy using a keyboard. It's fairly easy to add this using Unity's Selectable classes, but the ExpandableInspectorField isn't Selectable, so there isn't a way to navigate to it and expand/collapse it. I'm happy to implement this if you think it's a good idea, and believe there are two ways to do it:

  1. Change the current expand/collapse mechanism to a Button (currently it uses a PointerEventListener to catch the mouse click). This seems the more elegant solution, as conceptually it is a button.
  2. Subclass PointerEventListener from Selectable, so we can navigate to it and trigger it with the keyboard.

Thoughts?

Cheers, Brian

yasirkula commented 5 years ago

Hi!

In general, I usually don't navigate around user interfaces via keyboard and probably most users stick with a mouse, as well. But feel free to implement it via the first approach. I don't remember where PointerEventListener is used, so the second approach may have undesired effects. I can't promise that I'll merge your implementation with the main branch, though; hope you don't mind.

Best, Suleyman

bleppie commented 5 years ago

Thanks for the quick response and advice.

I use Unity for large projection installations, and I find it easier to use a wireless keyboard while walking around making adjustments rather than a mouse (or trackpad) to first select the input field and then switch to keyboard to enter new values.

I'll go ahead and implement it, and of course it's up to you if you merge or not!

Cheers, B

yasirkula commented 4 years ago

Decided not to add this feature to the plugin. Thanks for the feedback, though!