public void EnterInput() { input = currentInput; audioSource.Play(); InputEntered?.Invoke(); currentInput = ""; inputText.text = currentInput; HideMenu(); }
private void okButton_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(inputBox.Text)) { return; } var input = int.Parse(inputBox.Text); InputEntered?.Invoke(this, input); this.Close(); }
/// <summary> /// Käsittelee näppäimen painalluksen. /// </summary> /// <param name="key">Näppäin.</param> private void HandleKeyPress(VirtualKey key) { switch (key.Type) { case VirtualKeyType.Enter: EnterPressed?.Invoke(this, EventArgs.Empty); break; case VirtualKeyType.Backspace: BackspacePressed?.Invoke(this, EventArgs.Empty); break; case VirtualKeyType.Normal: default: InputEntered?.Invoke(this, new VirtualKeyboardInputEventArgs(key.Value)); break; } key.Pressed(); }
private static void OnMessageInput(string input) => InputEntered?.Invoke(input);