是否可以在不触摸键盘的情况下自动执行键盘快捷键? [英] Is it possible to execute keyboard shortcuts automatically without touching the keyboard?
本文介绍了是否可以在不触摸键盘的情况下自动执行键盘快捷键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们都知道按键盘上的Windows按钮会打开开始菜单。假设我想编写一个代码,在执行该程序时执行相同的操作,而不是实际触摸键盘。如果可能的话,你能指导我正确的方向吗?我试图用C ++实现同样的目标。
我尝试过的事情:
我无法在网上找到任何可能有用的正确解释。
解决方案
请拨打: MSDN:keybd_event function [ ^ ]传递两个虚拟键向下代码:CTRL,然后是ESC。然后传递两个虚拟键代码:ESC然后按CTRL
链接中有虚拟键代码的链接,以及一个基本示例。
We all know that pressing the windows button in the keyboard opens the start menu. lets suppose I want to write a code which does the same when I execute that program, instead of actually touching the keyboard. If its possible, can you direct me in the right direction? I am trying to achieve the same using C++.
What I have tried:
I am unable to find any proper explanation online that might help.
解决方案
Call this: MSDN: keybd_event function[^] Pass it two virtual key down codes: CTRL, and then ESC. Then pass it two virtual key up codes: ESC and then CTRL
There is a link to the Virtual key codes in the link, as well as a basic example.
这篇关于是否可以在不触摸键盘的情况下自动执行键盘快捷键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文