无法在 C# 中使用 Sendkeys 发送下划线?

发布于 2024-12-17 02:25:52 字数 237 浏览 3 评论 0原文

我很无聊,所以我尝试编写一个程序,在按 ctrl+shift+L 时写出不赞成的笑脸(ಠ_ಠ 脸)。 现在一切正常,除了笑脸中的下划线,它根本不会被写出来。

这是我首先使用的:

SendKeys.Send("ಠ_ಠ");

我尝试了各种方法,例如在下划线周围添加 {} 括号,当然我也用谷歌搜索了这个。

有什么办法可以让下划线发送吗?

提前致谢。

I've been bored, so I tried to make a program that writes a Look of Disapproval smiley(the ಠ_ಠ face) when pressing ctrl+shift+L.
Now everything works, except for the underscore that is in the smiley, which won't get written at all.

This was what I used first:

SendKeys.Send("ಠ_ಠ");

I've tried various things, like adding {} brackets around the underscore, and of course I googled this too.

Is there any way I can get the underscore to get sent?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

嗫嚅 2024-12-24 02:25:52

混合不同的编码会产生奇怪的结果。 是 Unicode,_ 是ASCII。不同长度的字符会让 Visual Studio 感到困惑和恼火。

尝试:

SendKeys.Send("\u0CA0_\u0CA0");

或:

SendKeys.Send("\u0CA0\u005F\u0CA0");

Mixing different encodings creates weird result. is Unicode, _ is ASCII. Different length characters confuse and iritate Visual Studio.

Try:

SendKeys.Send("\u0CA0_\u0CA0");

Or:

SendKeys.Send("\u0CA0\u005F\u0CA0");
情感失落者 2024-12-24 02:25:52

如果您不使用以下划线作为键的英文键盘布局,则您不能只键入 ASCII 字符,而必须将其写为修饰符和字符键的组合。

If you don't use an english keyboard layout that has the underscore as key you can't just type the ASCII character but have to write it as a combination of modifier and character keys.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文