Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Focussing a button in an editor window with tab or arrow up/down

Discussion in 'Immediate Mode GUI (IMGUI)' started by theH00b, Nov 23, 2015.

  1. theH00b

    theH00b

    Joined:
    Oct 12, 2015
    Posts:
    2
    Using tab or arrow up/down you can normally browse through the elements of editor windows. This does not seem to work with Button though. Neither in existing editor windows nor in editor windows I have created myself. Any ideas on how to fix this easily?
    Is this related to the fact that most elements are created from EditorGUILayout and the button only exists in GUILayout?

    A very simple example:
    Code (CSharp):
    1.         void OnGUI()
    2.         {
    3.             EditorGUILayout.TextField("element 1");
    4.             GUILayout.Button("element2", GUILayout.Width(100));
    5.             EditorGUILayout.TextField("element 3");
    6.         }
    7.