如何在Dragon NaturallySpeaking中编写一个语音命令,按住键持续X秒?

时间:2016-12-03 18:46:28

标签: keyboard naturallyspeaking

如何在Dragon NaturallySpeaking中写下一个声音命令,按住键持续X秒?

1 个答案:

答案 0 :(得分:1)

以下语音命令将按住 CTRL 键三秒钟。您可以更改密钥以及按住密钥的时间。

' Tested with Dragon NaturallySpeaking 12.5 Professional on Windows 7 SP1 x64 Ultimate
' From http://nuance-community.custhelp.com/posts/2cd74d2484
' Lindsay Adam
' www.pcbyvoice.com

Declare Function keybd_event Lib "user32.dll" (ByVal vKey As _
Long, bScan As Long, ByVal Flag As Long, ByVal exInfo As Long) As Long

' You can find all the virtual key codes in the following link:
' http://msdn.microsoft.com/en-us/library/ms927178.aspx
Const VK_CTRL = 17

Sub Main
    keybd_event(VK_CTRL,0,0,0)
    Wait(3)
    keybd_event(VK_CTRL,0,2,0)
End Sub

http://msdn.microsoft.com/en-us/library/ms927178.aspx(他们的robots.txt不允许我使用https://web.archive.org镜像他们的网站):

enter image description here