private void HandleHotkeys() { var keyboardState = Keyboard.GetState(); if (keyboardState.IsKeyUp(Keys.I) && _lastKeyboard?.IsKeyDown(Keys.I) == true) { _personPropButton.Click(); } else if (keyboardState.IsKeyUp(Keys.C) && _lastKeyboard?.IsKeyDown(Keys.C) == true) { _personStatsButton.Click(); } _lastKeyboard = keyboardState; }
private void Load() { var textSize = SizeConsts.TextSize1; Width = InputWidth; Height = InputHeight; AutoSizeAxes = Axes.Both; Children = new Drawable[] { NameInput = new() { Size = new Vector2(InputWidth * 0.75f, InputHeight), BorderColour = Color4.Red, Masking = true, }, SaveButton = new() { Action = () => LeaderboardContainer.AddEntry(NameInput.Text, Score), Width = InputWidth * 0.25f, Height = InputHeight, Icon = FontAwesome.Solid.Save, } }; NameInput.OnCommit += (_, _) => SaveButton.Click(); // Pressing enter clicks the button }