Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Screen Object / ControlKeySending Event
Example
In This Topic
    ControlKeySending Event
    In This Topic
    This event is triggered when a key or control key is about to be sent to the host. ControlKeySending allows you to modify a control key value or to cancel a send control key action before it is sent.
    Syntax
    private Sub Screen_ControlKeySending ( 
       ByVal sender As Object, _
       ByRef key As ControlKeyCode _
    ) As Boolean

    Parameters

    sender
    key
    This is a ControlKeyCode Enumeration value.
    Remarks

    To cancel the action, set ControlKeySending to False.

    Example
    These two events capture and print the keys and controlkeycode that were entered.
    'To run this example, copy it to the ThisScreen code window
    Public SentKeys As String
     
    Private Function Screen_ControlKeySending(ByVal sender As Variant, Key As Attachmate_Reflection_Objects_Emulation_OpenSystems.ControlKeyCode) As Boolean
     
        'Print the keys that are sent and the control key
        Debug.Print SentKeys & " <Key: " & Key & ">"
        
        
        Screen_ControlKeySending = True
        
        'Clear the SentKeys buffer
        SentKeys = ""
     
    End Function
     
    Private Sub Screen_KeysSent(ByVal sender As Variant, ByVal Keys As String)
     
        'Add the sent keys to the buffer
        SentKeys = SentKeys & Keys
     
    End Sub
    See Also