模拟右Shift + Ctrl键与SendKeys.Send() [英] Simulate right Shift+Ctrl with SendKeys.Send()

查看:743
本文介绍了模拟右Shift + Ctrl键与SendKeys.Send()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图发送正确的<大骨节病>移 + <大骨节病>控制我的的RichTextBox 。但默认发送左键

I'm trying to Send right Shift+Ctrl to my RichTextBox. But as default it sends the left keys.

SendKeys.Send("^+");



反正是有模拟右<大骨节病>移 + <大骨节病>控制

推荐答案

是的,你可以,你可以检查的虚拟键码其中用于右shift键和右控制键的代码是

Yes you can, you can check the Virtual-Key Codes where the code for the right shift key and right control key is

VK_RSHIFT   0xA1
VK_RCONTROL 0xA3

所以,你可以不喜欢

public const int VK_RSHIFT  = 0xA1;
public const int VK_RCONTROL= 0xA3;

您可以尝试这样的

SendKeys.Send(VirtualKeyCode.VK_RSHIFT);



否则你可以使用的键枚举

指定键代码和修改。

,指定

RShiftKey为右shift键和RControlKey为正确的控制键。

RShiftKey for the right shift key and RControlKey for the right control key.

或由kevintjuh93

or as commented by kevintjuh93

SendKeys.Send("^({RSHIFT}+)")

这篇关于模拟右Shift + Ctrl键与SendKeys.Send()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆