Product : Engine, Version : 5.0.0.1033, ArticleID : 41023723

HowTo : Space or Enter button to complete cmdSelect "USER"

Article41023723
TypeHowTo
ProductEngine
Version5.0.0.1033
Date Added9/29/2004
Submitted byBarry E. Mielke
Keywords

Subject

Space or Enter button to complete cmdSelect "USER"

Summary

Any way to get Space or Enter to complete cmdSelect "User" instead of only Right mouse button?
I was trying to find something to put in jobkeypress.

Solution

In the jobKeyPress event try to send two "end" using the PostCommandString. See our help.

Try the following code (Visual Basic 6) :
    Private Sub Command1_Click()
        VDPro1.CommandAction.CmdLine "USER"
    End Sub

    Private Sub Command2_Click()
        VDPro1.CommandAction.CmdSelect "USER"
        VDPro1.CommandAction.CmdMove VDPro1.ActiveDocument.Selections.FindName("VDRAW_PREVIOUS_SELSET"), Array(0, 0, 0), Array(1, 1, 1)
    End Sub

    Private Sub VDPro1_JobKeyPress(ByVal JobID As Long, KeyAscii As Integer, Cancel As Integer)
        If KeyAscii = VBRUN.KeyCodeConstants.vbKeySpace Or KeyAscii = VBRUN.KeyCodeConstants.vbKeyReturn Then '[EnterKey]=13 or [SpaceBar]=32 Pressed
            VDPro1.PostCommandString ""
            VDPro1.PostCommandString ""
        End If
    End Sub