示例#1
0
 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();
        }
示例#3
0
        /// <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();
        }
示例#4
0
 private static void OnMessageInput(string input) => InputEntered?.Invoke(input);