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
mode | code | decription |
---|---|---|
DEFAULT_SIGN_MODE | 0 | default signature mode |
DOCUMENT_VIEW_MODE | 5 | Document view mode |
DOCUMENT_SIGN_MODE | 6 | sign in document mode |
SIMPEL_DIALOG | 14 | Â simple dialog mode |
SubModeÂ
SubMode | code | The sub mode of the simple dialog mode |
---|---|---|
Idle mode | 0x00 | Â (MODE_PARAM_IDLE) |
Signing mode | 0x01: | Â (MODE_PARAM_SIGN) |
PenStateÂ
PenState | code | Description |
---|---|---|
simple dialog Pen up | 0 | |
Simpledialog pen down | 1 |
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;