VBScript 发送键 CTRL+LWIN+TAB? [英] VBScript SendKeys CTRL+LWIN+TAB?

查看:52
本文介绍了VBScript 发送键 CTRL+LWIN+TAB?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个简单的脚本,该脚本将发送 CTRL+WINDOWS KEY+TAB 的组合键.下面的代码发送键 CTRL+ALT+TAB

I am trying to write a simple script that will send the key combo of CTRL+WINDOWS KEY+TAB. The code below sends the keys CTRL+ALT+TAB

Set WshShell = WScript.CreateObject("WScript.Shell")
  WshShell.SendKeys "^%{TAB}"

但是,当我尝试用 LWIN(又名左 Windows 键)替换%"(又名 ALT 键)时,它说语法错误.

However when I try to replace "%" (aka the ALT key) with LWIN (aka the Left Windows Key) it says Syntax Error.

我尝试了以下方法,但没有成功:

I tried the following, but had no luck:

Set WshShell = WScript.CreateObject("WScript.Shell")
  WshShell.SendKeys "^{LWIN}{TAB}"

 

Set WshShell = WScript.CreateObject("WScript.Shell")
  WshShell.SendKeys "^{LWIN}+{TAB}"

 

Set WshShell = WScript.CreateObject("WScript.Shell")
  WshShell.SendKeys ^{LWIN}+{TAB}

我知道这与能够在按下其他键时按住某些键有关,但我似乎无法正确使用.

I know it has something to do with being able to Hold certain keys while other keys are pressed but I can't seem to get it right.

可以使用 CTRL+ESC 以编程方式按下 windows 键.有没有办法将此组合设置为名为 LWIN 的变量,然后使用上述脚本之一?

The windows key can be pressed programmatically using CTRL+ESC. Is there a way to set this combination as a variable called LWIN and then use one of the above Scripts?

推荐答案

以防万一有人在这些年登陆...
一种解决方法(而不是发送按键)是直接调用应用程序:

Just in case someone land here on these years...
A workaround (instead of sending keystrokes) is to call directly to the application:

Set objShell = CreateObject("Shell.Application")
objShell.WindowSwitcher

这将打开 Task Switcher Windows 应用程序.(同 ⊞ windows+TAB)

This will open Task Switcher Windows App. (Same as ⊞ windows+TAB)

这篇关于VBScript 发送键 CTRL+LWIN+TAB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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