コード例 #1
0
        public void Unfocus()
        {
            if (focused)
            {
                focused         = false;
                Main.blockInput = false;

                OnLostFocus?.Invoke(this, EventArgs.Empty);
            }
            //if (!eventSet) return;
            //eventSet = false;
            //keyBoardInput.newKeyEvent -= new Action<char>(KeyboardInput_newKeyEvent);
            //ModUtils.StartListeningForKeyEvents();
            //Main.AddKeyEvent();
        }
コード例 #2
0
        public virtual void Update(GameTime gameTime)
        {
            if (Hovering && GInput.MouseNewDown)
            {
                Focused = true;

                OnClicked?.Invoke(this);
            }
            else if (!Hovering && GInput.MouseNewDown)
            {
                Focused = false;

                OnLostFocus?.Invoke(this);
            }

            foreach (var _item in Items)
            {
                _item.Update(gameTime);
            }
        }
コード例 #3
0
 private void TextBox_LostFocus(object sender, RoutedEventArgs e)
 {
     OnLostFocus?.Invoke(this, e);
 }