vbs自动按键

weixin_45078264 2019-05-16 05:30:10
哪个大神帮我写一下这个小程序 按空格开始 按住ctrl键 连续按30次x键 按空格结束
...全文
663 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
milaoshu1020 2019-05-17
  • 打赏
  • 举报
回复
可以,不过如果是持续按ctrl的话,这个脚本可能无法做到;
它只能确保按下x的时候,ctrl是被按下的;
weixin_45078264 2019-05-17
  • 打赏
  • 举报
回复
引用 1 楼 milaoshu1020的回复:
代码如下,太快的话可以适当的添加"wscript.sleep 200":

set shell = createobject("wscript.shell")
shell.sendkeys " ",true
for i=1 to 30
shell.sendkeys "^x",true
next
shell.sendkeys " ",true
可以在游戏后台运行吗?
milaoshu1020 2019-05-16
  • 打赏
  • 举报
回复
代码如下,太快的话可以适当的添加"wscript.sleep 200":

set shell = createobject("wscript.shell")
shell.sendkeys " ",true
for i=1 to 30
shell.sendkeys "^x",true
next
shell.sendkeys " ",true

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧