OnDeviceButton, OnDeviceButtonEx
Declaration
HRESULT OnDeviceButton([in] long ButtonEvent);
HRESULT OnDeviceButtonEx([in] long ButtonEvent, [in] long LParam);
Description
This event is fired when virtual LCD button is pressed.
Arguments
ButtonEvent
Return Value of OnDeviceButtonEx contains ButtonID and Mode.
ok = 13500416 -> 0x00CE0000 => Bit 31-16 : 00CE = Button 206, Bit 15-0 : 0000Â = Pad Mode 0 (SignatureMode)
ButtonID ( more info)Â Â
Button | code | Description |
---|---|---|
simple dialog Pen up | 0 | |
Simpledialog pen down | 1 | |
HID_CMD_BUTTON_ZOOM_P | 200 | |
HID_CMD_BUTTON_ZOOM_M | 201 | |
HID_CMD_BUTTON_NEXT | 202 | |
HID_CMD_BUTTON_PREVÂ Â Â Â | 203 | |
HID_CMD_BUTTON_START_SIGN | 204 | |
HID_CMD_BUTTON_ROTATE | 205 | obsolete |
HID_CMD_BUTTON_ROTATE180 | 205 | |
HID_CMD_BUTTON_OK | 206 | |
HID_CMD_BUTTON_REPEAT | 207 | |
HID_CMD_BUTTON_CANCELÂ Â Â Â Â | 208 | |
HID_CMD_BUTTON_ROTATE90 | 209 | Portrait / Landscape (only duraSign Pad 10.0 ) |
HID_CMD_BUTTON_JUMP_PAGE | 210 | Jumps to specified page number starting with 1 for the first page, only i/aStepOverCapture App |
HID_BUTTON_PAD_REMOVED | 255 | virtual Button, the pad is removed |
HID_BUTTON_SCRIPT_FINISHED | FFFFFFFFh (-1) | dialog finished |
Mode types
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 |
4 | sign with background image on bw | |
15 | continous scrolling document viewing mode | |
SIMPLE_DIALOG | 14 | Â simple dialog mode |
LParam
The meaning of LParam argument depends on ButtonEvent value.
ButtonEvent | LParam |
---|---|
HID_CMD_BUTTON_SCRIPT_FINISHED | Last dialog event. |
HID_CMD_BUTTON_JUMP_PAGE | requested pdf page number, starting with 1 for the first page, which should be sent to smartphone by LCDImageEx(R) with type 8 , x= requested page number and y = page count to smartphone |
SimpleDialog | Holds Pen pressed Cordinates X and Y |
All other values | User-defined parameter, can be set by SetDriverLong, key=37. |
Sample
C#
// Event for Device Button Press SigDev.OnDeviceButtonEx += new AxStepOverSignatureDevice1.IStepOverSignatureDeviceEvents_OnDeviceButtonExEventHandler(SigDev_OnDeviceButtonEx); Â private void SigDev_OnDeviceButtonEx(object sender, AxStepOverSignatureDevice1.IStepOverSignatureDeviceEvents_OnDeviceButtonExEvent e) { // forward Event to SignAPI so it can react in DocView axSignAPIv4.OnDeviceLCDButtonHandler(e.buttonEvent); int ID = Convert.ToInt32(e.buttonEvent >> 16); int Mode = Convert.ToInt32(e.buttonEvent & 0xFFFF); // Check for ID switch (ID) { case 206: // OK Button break; case 207: // Repeat Button break; case 208: // Abort Button break; } } Â
Delphi
const WM_PADBUTTON_PRESS = WM_USER + $0012; type TMainForm = class(TForm) ... StepOverSignatureDevice1: TStepOverSignatureDevice; ... procedure StepOverSignatureDevice1DeviceButtonEx(Sender: TObject; ButtonEvent, LParam: Integer); private: procedure OnPadButtonPress(var Msg: TMessage); message WM_PADBUTTON_PRESS; ... end; procedure TEsoMainForm.StepOverSignatureDevice1DeviceButtonEx(Sender: TObject; ButtonEvent, LParam: Integer); begin // do not block this message !, we send ourself a new message PostMessage(Handle, WM_PADBUTTON_PRESS, ButtonEvent, LParam); end; procedure TEsoMainForm.OnPadButtonPress(var Msg: TMessage); var padmode : Integer; buttoncode : Integer; ButtonEvent : Cardinal; begin ButtonEvent := Msg.WParam; buttoncode := (Cardinal(ButtonEvent) shr 16) and $0000FFFF; padmode := Cardinal(ButtonEvent) and $0000FFFF; // Check for ID case ID of 206: begin // OK Button end; 207: begin // Repeat Button end; 208: begin // Abort Button end; end; end;
VB.Net
AddHandler SignatureDevice.OnDeviceButtonEx, AddressOf OnDeviceButtonExEventHandler Private Sub OnDeviceButtonExEventHandler(sender As Object, e As IStepOverSignatureAPIv4Events) 'Forward Event to SignAPI so it can response in DocView Mode SignatureAPIv41.OnDeviceLCDButtonHandler(e.buttonEvent) Dim ID As Integer = Convert.ToInt32(e.buttonEvent >> 16) Dim Mode As Integer = Convert.ToInt32(e.buttonEvent << 16) 'Check buttonID Select Case ID Case 204 'Repeat Button Dim BCtrlDelegate As BtnCtrlDelegate = AddressOf ButtonControl Me.Invoke(BCtrlDelegate, New Object() {False}) Case 206 'OK Button, you can confirm Signature If (SignatureAPIv41.GetLoadedDocName() = "" Or SignatureAPIv41.GetLoadedDocName() = Nothing) Then Dim BCtrlDelegate As BtnCtrlDelegate = AddressOf ButtonControl Me.Invoke(BCtrlDelegate, New Object() {False}) Else Dim BCtrlDelegate As BtnCtrlDelegate = AddressOf ButtonControl Me.Invoke(BCtrlDelegate, New Object() {True}) End If Case 207 ' OK Repeat, you can restart signing Dim BtnCtrlDelegate As BtnCtrlDelegate = AddressOf ButtonControl Me.Invoke(BtnCtrlDelegate, New Object() {True}) Case 208 ' Abort, you can abort signing Dim BCtrlDelegate As BtnCtrlDelegate = AddressOf ButtonControl Me.Invoke(BCtrlDelegate, New Object() {False}) End Select End Sub