如何使用SAPI 5.1模拟键盘按键 [英] How to simulate keyboard keys using SAPI 5.1
本文介绍了如何使用SAPI 5.1模拟键盘按键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们如何使用SAPI模拟键盘功能.
我的意思是说,如果我说"F1",则应弹出帮助"菜单.
谁能解释一下流程.
谢谢
How do we simulate key board functions using SAPI.
I mean to say, if I say "F1", then Help menu should pop out.
Can anyone please explain the flow.
Thanks
推荐答案
这需要几个步骤:
1.设置并训练语音识别引擎
2.引入关键字,以便将随后的单词识别为按键;例如击键F1".这样可以避免不必要的窗户打开(在上一场F1比赛中,迈克尔·舒马赫……")
3.使用SAPI,设置一个事件,该事件在识别到按键"时触发回调函数.
4.使用映射表令牌<->键代码
解释下一个令牌(在示例中为"F1") 5.使用API函数模拟击键,例如: SendKeys [ ^ ]
This requires several step:
1. Set up and train the speech recog engine
2. Introduce a keyword, so that the following word is recognized as a key stroke; for instance "Key stroke F1". This avoids unwanted windows opening ( "In the last F1 race, Michael Schumacher...")
3. Using the SAPI, set up an event that triggers a callback function when "Key Stroke" is recognized.
4. Interpret the next token ("F1" in the example) using a mapping table token<->key code
5. Emulate the keystroke using an API function, for instance: SendKeys[^]
这篇关于如何使用SAPI 5.1模拟键盘按键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文