OnDevicePenEventHandler

Declaration

 HRESULT OnDevicePenEventHandler([in] long PadMode, [in] long SubMode, [in] long PenState, [in] long XPos, [in] long YPos, [in] long LParam);

Description

Event returns the coordinates of the press and release event from the pen. The event is only returned when the Pad is inside the Dialog Modus and it doesn´t return coordinates of the signature. The Event can be used to realize clickable elements like buttons, checkboxes, radiobuttons, dropboxes. This Event will only be triggert when you inside the SimpleDialog Mode.

Arguments

PadMode

modecodedecription
DEFAULT_SIGN_MODE0default signature mode
DOCUMENT_VIEW_MODE5Document view mode
DOCUMENT_SIGN_MODE6sign in document mode
SIMPEL_DIALOG14 simple dialog mode


SubMode 

SubModecodeThe sub mode of the simple dialog mode
Idle mode0x00

  (MODE_PARAM_IDLE)

Signing mode0x01:  (MODE_PARAM_SIGN)


PenState 

PenStatecodeDescription
simple dialog Pen up0
Simpledialog pen down1


XPos - X coordinate of the pen

YPos - Y coordinate of the pen


LParam

Not used now

Sample

C#
//  Register the Pen Event Handler which will trigger by pen-press and pen-release
SigDev.OnDevicePenEventHandler += onDevicePenEventHandler;
 
private void onDevicePenEventHandler(int PadMode, int SubMode, int PenState, int XPos, int YPos, int LParam)
{
	//  PenState 1 = Pressed-Event |  PenState 0 = Release-Event
	int ButtonEventID = PenState;

	Dialog.Show("PenState: " + PenState + " | Parameter: " + XPos + "/" + YPos);
}
Delphi
//  Register the Pen Event Handler which will trigger by pen-press and pen-release
SigDev.OnDevicePenEventHandler := StepOverSignatureDevice1DevicePenEventHandler;

procedure TForm1.StepOverSignatureDevice1DevicePenEventHandler(Sender: TObject; PadMode: Integer;
                                                            SubMode: Integer;
                                                            PenState: Integer;
                                                            XPos: Integer;
                                                            YPos: Integer;
                                                            LParam: Integer);
begin
    //  PenState 1 = Pressed-Event |  PenState 0 = Release-Event
    LabelStatus.Caption := 'PenState: ' + Inttostr(PenState) + ' | Parameter: ' + Inttostr(XPos) + ' / ' + Inttostr(YPos);
end;