gpt4 book ai didi

c# - SendKeys.SendWait 函数 - 向应用程序发送特殊 key

转载 作者:太空狗 更新时间:2023-10-30 00:53:30 25 4
gpt4 key购买 nike

我想弄清楚如何将字符“^”(不是 CTRL 命令)发送到外部文本窗口。

我试过的不同代码:

SendKeys.SendWait("^");
SendKeys.SendWait("(^)");
Sendkeys.SendWait("{^}"); //This should be the right code, but it doesn't work either

这些都不会在文本字段中输入字符“^”。如果我将普通文本发送到窗口,它就会出现在窗口中。 “^”无法以某种方式输入。我查看了 MSDN 和联机帮助,但找不到任何接近该问题的内容。有什么想法吗?

最佳答案

要使用 SendKeys.SendWait() 发送字符“^”,您需要考虑实际按下的是哪些键。在 en-US 键盘上,它是 Shift & 6,转换为:

SendKeys.SendWait("+6");

因此,无论您使用哪个组合键生成“^”字符,请将这些组合键输入到 SendKeys.SendWait() 调用中。

关于c# - SendKeys.SendWait 函数 - 向应用程序发送特殊 key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16220666/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com