CursorDown Event

CursorDown Event

Occurs when the cursor tip contacts the digitizing tablet surface.

Declaration

[C++]

void CursorDown(
    [in] IInkCursor* Cursor,
    [in] IInkStrokeDisp* Stroke
);

[Microsoft® Visual Basic® 6.0]

Public Event CursorDown( _
    Cursor As IInkCursor, _
    Stroke As IInkStrokeDisp _
)

Parameters

Cursor

[in] The IInkCursor object that generated the CursorDown event.

Stroke

[in] The IInkStrokeDisp object that was started when the IInkCursor object caused the CursorDown event to fire.

Remarks

These event methods are defined in the _IInkCollectorEvents, _IInkOverlayEvents, and _IInkPictureEvents interfaces. The _IInkCollectorEvents, _IInkOverlayEvents, and _IInkPictureEvents interfaces implements the IDispatch Leave Site interface with an identifier of DISPID_ICECursorDown.

Use this event carefully because it could have an adverse effect on ink performance if too much code is executed in the event handlers. To improve real-time ink performance, hide or show the mouse cursor in the MouseDown and MouseUp event handlers.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example demonstrates using event handlers to display CursorDown events, DoubleClick events, CursorInRange events, CursorOutOfRange events, and TabletAdded events, and TabletRemoved events. This simple application has a text edit control, Text1, where messages appear when events are received.

Option Explicit
Dim WithEvents theInkCollector As InkCollector

Private Sub Form_Load()
    Set theInkCollector = New InkCollector
    theInkCollector.hWnd = Me.hWnd
    theInkCollector.Enabled = True

    theInkCollector.SetEventInterest ICEI_CursorDown, True
    theInkCollector.SetEventInterest ICEI_DblClick, True
    theInkCollector.SetEventInterest ICEI_TabletAdded, True
    theInkCollector.SetEventInterest ICEI_TabletRemoved, True
End Sub

Private Sub theInkCollector_CursorDown( _
ByVal Cursor As MSINKAUTLib.IInkCursor, _
ByVal Stroke As MSINKAUTLib.IInkStrokeDisp)
    Text1.Text = "Cursor " & Cursor.Name & " down"
End Sub

Private Sub theInkCollector_CursorInRange( _
ByVal Cursor As MSINKAUTLib.IInkCursor, _
ByVal NewCursor As Boolean, _
ByVal ButtonsState As Variant)
    Text1.Text = "Cursor " & Cursor.Name & " in range"
End Sub

Private Sub theInkCollector_CursorOutOfRange( _
ByVal Cursor As MSINKAUTLib.IInkCursor)
    Text1.Text = "Cursor " & Cursor.Name & " out of range"
End Sub

Private Sub theInkCollector_DblClick(Cancel As Boolean)
    Text1.Text = "DblClick"
End Sub

Private Sub theInkCollector_TabletAdded( _
ByVal Tablet As MSINKAUTLib.IInkTablet)
    Text1.Text = _
    "Added tablet " & Tablet.Name & "   Id: " & Tablet.PlugAndPlayId
End Sub

Private Sub theInkCollector_TabletRemoved(ByVal TabletId As Long)
    Text1.Text = "Removed tablet " & TabletId
End Sub

Applies To