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(); }
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); } }
private void TextBox_LostFocus(object sender, RoutedEventArgs e) { OnLostFocus?.Invoke(this, e); }