SendDragonKeys

Sends keystrokes to the active window. If SendDragonKeys fails to send the specified keystrokes, try using SendSystemKeys.

Syntax

SendDragonKeys "type this"

Argument Description
type this The keystrokes to be sent to the active window. Enclose the names of nonprinting keys in braces ({ }). To specify a shift-key combination, enclose the modifier key name (such as Alt), a plus sign (+), and the shifted key in braces. To repeat a keystroke or key combination, enclose the key name, a space, and the number of repetitions in braces.

Example 1

This instruction sends three CTRL+RIGHT keystrokes to the active window.

SendDragonKeys "{Ctrl+Right 3}"

Example 2

This example carries out the Set Font <Face> command by sending the Font dialog box access keys and the value of the list variable ListVAR1 (the keystrokes that set the font to the spoken face). Plus signs are used to concatenate the keystroke strings and the variable.

SendDragonKeys "{Alt+o}f{Alt+f}"+ListVAR1+"{Enter}"

Notes

  • Scripting commands from Dragon version 5 that use the Dragon List Variables will only function when the .dvc file is imported. You cannot create new commands using these old Dragon List Variables.
  • Sending uppercase characters is equivalent to sending SHIFT plus the character. For example, A and {Shift+a} are equivalent.
  • Do not include spaces between the names of simultaneously pressed keys, such as Alt+Tab.
  • Any modifier keys (SHIFT, CTRL, ALT) pressed while the SendDragonKeys command executes do not affect the command action.
  • You should test the use of SendDragonKeys under varying conditions to avoid unpredictable results.
  • Use a DdeExecute instruction, rather than SendDragonKeys, if you cannot be sure a key sequence always produces the same result.
  • You can use 0 to indicate zero repetitions of a key. This feature is useful for scripts where a keystroke may be used 0 or more times, depending upon a variable value.