Example #1
0
        public virtual void CheckForKeyboardEvents()
        {
            if (!bWindowHasFocus)
            {
                return;
            }

            KeyCode RenameKeycode = KeyCode.Return;

        #if UNITY_EDITOR_WIN
            RenameKeycode = KeyCode.F2;
        #endif // UNITY_EDITOR_WIN

            if (InputState.IsKeyDown(RenameKeycode))
            {
                ListItem <ListType> SingleSelection = null;

                foreach (ListItem <ListType> CurrentItem in ListItems)
                {
                    if (CurrentItem.IsSelected())
                    {
                        if (SingleSelection == null)
                        {
                            SingleSelection = CurrentItem;
                        }
                        else
                        {
                            SingleSelection = null;

                            break;
                        }
                    }
                }

                if (SingleSelection != null && !SingleSelection.IsInEditMode())
                {
                    SingleSelection.SetIsInEditMode(true);

                    InputState.HandleKeyDown(RenameKeycode);
                }
            }
        }