private void WrapperOnEnterDown() { EnterClick?.Invoke(this); _keyboardInputSimulator.OnEnterButton(); }
private void KeyDown_MouseDown(object sender, MouseEventArgs e) { if (sender is Label lbl) { if (string.IsNullOrEmpty(lbl.Text)) { return; } //切换大写 if (lbl.Text == "CAP") { ToUpperOrLower(this, true); lbl.Text = "cap"; } //切换小写 else if (lbl.Text == "cap") { ToUpperOrLower(this, false); lbl.Text = "CAP"; } //切换字符或数字 else if (lbl.Text == "?123" || lbl.Text == "abc.") { ChangeShow(this); } else if (lbl.Text == "空格") { SendKeys.Send(" "); } else if (lbl.Text.ToLower() == "shift") { SendKeys.Send("+"); if (lbl.Text == "shift") { lbl.Text = "SHIFT"; } else { lbl.Text = "shift"; } } else if (lbl.Text == "删除") { SendKeys.Send("{BACKSPACE}"); BackspaceClick?.Invoke(sender, e); } else if (lbl.Text == "回车") { SendKeys.Send("{ENTER}"); EnterClick?.Invoke(sender, e); } else if (lbl.Text == "关闭") { CloseClick?.Invoke(this, e); } else { string str = "{" + lbl.Text + "}"; SendKeys.Send(str); KeyClick?.Invoke(sender, e); } } }