VB脚本发送密钥

发布于 2024-09-15 13:51:52 字数 236 浏览 3 评论 0原文

我有一个需要运行的进程,只能通过快捷键 CTRL+ALT+RIGHT SHIFT 运行。

为了让用户更轻松,我想创建一个桌面快捷方式来单击以运行此快捷方式。

我认为可以通过 vbs 脚本 sendkey 来完成此操作。

我在我的研究中说不能指定右shift键是正确的吗?

我知道有 ^% 用于 CTRL 和 ALT,+ 用于通用移位,但这不适用于右移位。

我有办法做到这一点吗?

I have a process I need to run which can only be run by shortcut keys which are CTRL+ALT+RIGHT SHIFT

To make it easier for users I would like to create a desktop shortcut to click on to run this shortcut.

The way I thought this could be done is by vbs script sendkey.

Am I right in my research to say that right shift key can not be specified?

I know there is ^% for CTRL and ALT and + for generic shift but that does not work for right shift.

Is there a way for me to do this?

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

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

发布评论

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

评论(2

鹿童谣 2024-09-22 13:51:52

我建议您使用AutoHotkey

它具有非常强大、经过验证的“sendkey”功能,包括发送右移的能力。

您的脚本将很简单:

SendInput,^!{RSHIFT}

此外,它还附带一个实用程序,可以将脚本编译为 .exe,这就是您希望在桌面上使用的文件。

I recommend that you use AutoHotkey.

It has a very robust, proven "sendkey" functionality, including the ability to send right shift.

Your script would simply be:

SendInput,^!{RSHIFT}

Furthermore, it comes with a utility that will compile the script into a .exe, which is what you'd want to use on the desktop.

你如我软肋 2024-09-22 13:51:52

为此,我使用自己的开源软件“sendkeys v0.0.1”。您可以在 Visual Studio 2013 中将其编译为 C# 控制台应用程序。

来源: Sendkey v0.0.1

然后使用在像这样的命令窗口中:

 Sendkey CONTROL down
 Sendkey MENU down
 Sendkey RSHIFT down
 Sendkey CONTROL up
 Sendkey MENU up
 Sendkey RSHIFT up

或者在 vbscript 中使用 .Exec() 方法。

(注意命令窗口是微软俚语中的“终端”或“控制台”)

I use my own open source software "sendkeys v0.0.1" for this. You can compile it as a C# console application in Visual Studio 2013.

Source: Sendkey v0.0.1

Then use it in a command window like this:

 Sendkey CONTROL down
 Sendkey MENU down
 Sendkey RSHIFT down
 Sendkey CONTROL up
 Sendkey MENU up
 Sendkey RSHIFT up

Or in vbscript using the .Exec() method.

(N.B. command window is Microsoft slang for 'terminal' or 'console')

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