# Appendix B

# Elo Software Development Kit

## Introduction

Elo SDK provides a programmers API for communication with the Elo Serial and USB drivers. The functionality available for programming is as follows:

### Get Raw and Calibrated Touch Points from the Touchscreen

> > Gets touch data from the controller. This data can be retrieved in raw elo coordinates or translated windows coordinate format. To get data use EloGetTouch. This call may block depending on the flags used for type of data expected. To cancel the blocking call use EloCancel.

> > EloGetTouch

> > EloCancel

> ### Change Touchscreen Operation Modes

> > Touchscreen operates in the following modes:

> > Click On Touch: Click on touch immediately sends a mouse down/up message at the point of touch on the touchscreen. The user's finger must be removed from the touchscreen before a new touch at any location will be recognized. The cursor or selected objects CANNOT be "dragged" on the screen in this mode.

> > Click On Release: At the time of release (untouch), a mouse down/up message is sent at the point that the screen was last touched. Dragging across objects on the screen will not highlight or select them unless untouch occurs when the touch is over the object. (Drag and Double-click)

> > Mouse Emulation: Sends a mouse down message at the point of contact. Selects an object if it was at the initial point of contact. Drags a selected object on the screen. Sends a mouse up message at the point of untouch. Double-clicks on an object when the screen is touched twice in succession at the same location.

> > These are the same as the touch modes in the Elo Control Panel. You may get or change the operation mode using the calls listed below:

> > EloGetMouseMode

> > EloSetMouseMode

> ### Configure Drag Delay

> > Dragdelay allows the drag functionality for touchscreen. Touchscreen must be calibrated before using this functionality. This value can be retrieved or modified using:

> > EloGetDragDelay

> > EloSetDragDelay

> ### Enable/Disable Touch Functionality

> > The Touchscreen can be enabled to report touch data to the windows system or disabled not to report any touch data.

> > EloGetTouchState

> > EloSetTouchState

### Configure Sound During Touch

> > Every complete touch is indicated by a beep from the system. Touchscreen must be calibrated before using this functionality. The frequency and time and beep is configurable.

> > EloGetBeep

> > EloSetBeep

### Save Alignment for Touchscreen Using Calibration API

> > Elo provides a standard calibration utility for video alignment. The CALIBRATION is used to convert touches from the Elo coordinate system to Windows virtual coordinate system.

> > The driver uses the following equation to convert a raw touch coordinate point from Elo coordinate system to the Windows screen coordinate system.

> > Calibration equation is

> > Xcal = a + m*Xuncal,

> > where,

> > Xuncal, is in Elo coordinate system

> > Xcal, is in Windows coordinate system

> > m = nScrDx / nEloDx

> > "a", is the X offset value entry

> > nScrDx = distance between targets in Windows virtual coordinates

> > nEloDx = distance between targets in Elo coordinates.

> > This is specially useful if you want to save the calibration over the network or some other place, and later configure the touchscreen using one common set of data.

> > To get the current calibration data from the driver, use EloGetCalibrationData. For changing the calibration data use EloSetCalibrationData.

> > EloGetCalibrationData

> > EloSetCalibrationData

### Define Touchscreen Boundary

> > Touchscreen boundary defines the bounding rectangle for the touchscreen on Windows virtual desktop. This allows / prohibits touch on one monitor from being propagated to the corresponding monitor. Touchscreen must be calibrated before using this functionality.

> > EloGetTouchBoundary

> > EloSetTouchBoundary

### Swap Touchscreen Buttons

> > Use this call to use the touchscreen with swapped button for next couple of touches on the screen.

> > Swaps the button for the touch monitor for the touch count specified. Once the count is exhausted, the SDK notifies the application by sending a WM_SWAPBUTTON message to the application window. Touchscreen must be calibrated before using this functionality.

> > EloSwapButton

### Configure Touchscreen for Left-handed Users

> > For left-handed users of mouse, set the touchscreen mode using EloSetLeftHandedMouse call.

> > EloSetLeftHandedMouse

### Retrieve Touchscreen Diagnostic Data

> > Diagnostic information for touchscreen can be retrieved using EloGetDiagnosticsData.

> > This information is also displayed in the Elo Control panel>Properties tab.

> > EloGetDiagnosticData

### Configure Touchscreen for Gaming Specific Mode by Enabling Quick Touch

> > Quick touch is an enhanced mode of the touchscreen, usually used for gaming purposes.

> > In standard operation, touches on screen following each other very quickly in "Mouse Emulation" mode creates a system drag box.

> > This feature allows the touches following each other quickly to be interpreted as independent touches resulting in separate mouse clicks.

> > Touchscreen must be calibrated before using this functionality.

> > EloGetQuickTouch

> > EloSetQuickTouch

### Configure Edge Acceleration Feature

> > Touching towards the edge of the touchscreen can be difficult at times. This feature allows the cursor to be accelerated towards the screen edges.

> > Touchscreen must be calibrated before using this functionality.

> > EloGetAcceleration

> > EloSetAcceleration

### Define Touchscreen to Automatically Timeout After Constant Touch in Same
Location Using Untouch Timeout Feature

> > If touches are created in the same constant location, an automatic untouch is generated by the driver based on this timeout.

> > For dirt on a screen this is a very handy feature.

> > Touchscreen must be calibrated before using this functionality.

> > EloGetUntouchTimeout

> > EloSetUntouchTimeout

### Configure Right Click on Hold Functionality

> > This feature allows touchscreen to generate right clicks. A right click is generated when the user continues to touch the screen. Touchscreen must be calibrated before using this functionality. This can be configured using:

> > EloGetRightClickOnHold

> > EloSetRightClickOnHold

EloPubIf.lib provides the SDK for communicating with Elo Serial and USB drivers. In order to communicate with the either of the drivers, add this library to the list of compile time dependencies of your application and use the appropriate interface function calls in your program. Include the header file, EloInterface.h and EloErrorCodes.h in your application.

These files can be found on Program Files\EloTouchsystems folder.

Please refer to the Appendix C, EnableDisable Sample Code for interface usage.

## Elo Device Interface Functions

### Function Name: EloGetScreenInfo

int EloGetScreenInfo(DWORD dwMonNum[32], int iScrCnt)

Parameters:
dwMonNum [in]: Array of DWORD to receive the Windows monitor number associated with the touchscreens.

iScrCnt [out]: It retrieves the total number of Elo touchscreens found.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:

It returns the list of Windows monitor numbers associated with the touchscreens where, the index is the touchscreen number and the value is the Windows monitor number.

Touchscreens are 0 based and Windows monitor numbers are 1 based.

If a touchscreen is not calibrated, the windows monitor is returned as -1.

Maximum of 32 touchscreens are supported.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also Sample and Error Codes

### Function Name: EloGetTouch

int EloGetTouch (PTOUCH_POINT xy, BOOL xlated, GETPOINTS_CODE getCode, UINT nScrNo)

Parameters:
xy [out]: Pointer to TOUCH_POINT structure to receive the touch coordinates from the touchscreen. The application is responsible for allocating / freeing memory. Please see structure definition section for TOUCH_POINT.

xlated [in]: If TRUE, the coordinates are returned translated for Windows coordinate system. If FALSE, raw coordinate data are returned.

getCode [in]: This can be one of the following values: ReturnImmediately, ReturnOnTouch, ReturnOnUntouch, ReturnOnNextValidTouch. Please see definition for GETPOINTS_CODE.

nScrNo [in/out]: This must be initialized to the zero based touchscreen number. Returns the zero based touchscreen number for the touchscreen touched.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Unless the ReturnImmediately GetCode value is used, this call will not return until the user touches the screen specified.

To cancel the blocking wait use the EloCancel function.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also EloCancel, EloGetScreenInfo, Sample and Error Codes

### Function Name: EloCancel

int EloCancel()

Parameters:
None.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Cancels any pending request with the driver.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also EloGetTouch,EloGetScreenInfo, Sample and Error Codes

### Function Name: EloGetMouseMode

int EloGetMouseMode (WORD *wMode,UINT nScrNo)

Parameters:
wMode [out]: Returns the touchscreen mode. Please see Constant definition section for TOUCHSCREEN_MODE.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Retrieves the touch mode for the specified touchscreen.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also EloSetMouseMode, EloGetScreenInfo, Sample and Error Codes

### Function Name: EloSetMouseMode

int EloSetMouseMode (WORD wMode,UINT nScrNo)

Parameters:
wMode [in]: Touchscreen mode. Please see Constant definition section for TOUCHSCREEN_MODE.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Sets the touch mode for the specified touchscreen to wMode.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also EloGetMouseMode, EloGetScreenInfo, Sample and Error Codes

### Function Name: EloGetTouchReportingState

int EloGetTouchReportingState (BOOL *bFlag , UINT nScrNo)

Parameters:
bFlag [out]: Touch state enabled / disabled. If TRUE, touch data is reported. If FALSE, touch data is not reported.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Gets the touch state for touchscreen specified. It saves it in bFlag.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also EloSetTouchReportingState, EloGetScreenInfo, Sample and Error Codes

### Function Name: EloSetTouchReportingState

int EloSetTouchReportingState (BOOL bFlag, int nScrNo)

Parameters:
bFlag [in]: Touch state enabled / disabled. If TRUE, touch data is reported. If FALSE, touch data is not reported.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Enables or Disables touch depending on bFlag.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also EloGetTouchReportingState, EloGetScreenInfo, Sample and Error Codes

### Function Name: EloGetDragDelay

int EloGetDragDelay (PDRAG_DELAY pDragDelay,UINT nScrNo)

Parameters:
pDragDelay [out]: Pointer to DRAG_DELAY to receive Drag Delay . Please see structure definition section for PDRAG_DELAY.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Gets the dragdelay parameters for the specified touchscreen.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also EloSetDragDelay , EloGetScreenInfo, Sample and Error Codes

### Function Name: EloSetDragDelay

int EloSetDragDelay (PDRAG_DELAY pDragDelay, UINT nScrNo)

Parameters:
pDragDelay [in]: Dragdelay data. Please see structure definition section for DRAG_DELAY.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Sets the drag delay for the specified touchscreen.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also EloGetDragDelay , EloGetScreenInfo, Sample and Error Codes

### Function Name: EloGetBeep

int EloGetBeep (PBEEP pBeepVal, UINT nScrNo)

Parameters:
pBeepVal [out]: Pointer to BEEP structure to receive data. Please see structure definition section for BEEP.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Gets the touchscreen beep data for the specified touchscreen.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also EloSetBeep, EloGetScreenInfo, Sample and Error Codes

### Function Name: EloSetBeep

int EloSetBeep (PBEEP pBeepVal, UINT nScrNo)

Parameters:
pBeepVal [in]: Pointer to sound structure to receive data. Please see structure definition section for BEEP definition.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Sets the touchscreen beep data for the specified touchscreen.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also EloGetBeep, EloGetScreenInfo, Sample and Error Codes

### Function Name: EloGetTouchBoundary

int EloGetTouchBoundary(PTOUCH_BOUNDARY ptBndry , UINT nScrNo)

Parameters:
ptBndry [out]: Pointer to TOUCH_BOUNDARY structure containing full screen boundary data in pixels. Please see structure definition section for TOUCH_BOUNDARY.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Gets the full screen bounding rectangle and bounding mode for the specified touchscreen.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also EloSetTouchBoundary, EloGetScreenInfo, Sample and Error Codes

### Function Name: EloSetTouchBoundary

int EloSetTouchBoundary(PTOUCH_BOUNDARY ptBndry, UINT nScrNo)

Parameters:
ptBndry [in]: Pointer to TOUCH_BOUNDARY structure containing full screen boundary data in pixels. Please see structure definition section for TOUCH_BOUNDARY.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Sets the full screen bounding rectangle and bounding mode for the specified touchscreen.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also EloGetTouchBoundary, EloGetScreenInfo, Sample and Error Codes

### Function Name: EloGetCalibrationData

int EloGetCalibrationData (PCALIBRATION pCalData, UINT nScrNo)

Parameters:
pCalData [out]: Pointer to CALIBRATION structure to receive the calibration data. Please see structure definition section for CALIBRATION.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Retrieves the calibration data for the specified touchscreen.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also EloSetCalibrationData, EloGetScreenInfo, Sample and Error Codes

### Function Name: EloSetCalibrationData

int EloSetCalibrationData (CALIBRATION *pCalData,UINT nScrNo)

Parameters:
pCalData [in]: Pointer to CALIBRATION structure which stores the calibration data for the touchscreen. Please see structure definition section for CALIBRATION.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Sets the calibration data for the specified touchscreen.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also EloGetCalibrationData, EloGetScreenInfo, Sample and Error Codes

### Function Name: EloSwapButton

int EloSwapButton (HWND hWnd, DWORD dwCnt, UINT nScrNo)

Parameters:
hWnd [in]: Handle to window to receive the WM_ELOSWAPBUTTON message. if NULL, there is no message.

dwCnt [in]: Touch count for which the button should be swapped.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Swaps the button for the touch monitor for the touch count specified in dwCnt. Once the count is exhausted the DLL notifies the application, by sending a WM_ELOSWAPBUTTON message to the application window specified in hWnd.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also: EloGetScreenInfo, Sample and Error Codes

### Function Name: EloSetLeftHandedMouse

int EloSetLeftHandedMouse (BOOL bFlag)

Parameters:
bFlag [in]: If TRUE it sets touchscreen mode to left-handed mouse.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Sets the touchscreen mode to left-handed mouse. This does not affect the Windows left-handed mouse settings.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also: EloGetScreenInfo, Sample and Error Codes

### Function Name: EloGetDiagnosticsData

int EloGetDiagnosticsData(PSCREEN_PROPERTIES pData, UINT nScrNo)

Parameters:
pData [in]: Pointer to SCREEN_PROPERTIES structure to receive the diagnostics for the touchscreen. Please see structure definition section for SCREEN_PROPERTIES.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSucces if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Gets the diagnostics for the specified touchscreen. This information is also displayed in the Elo Control panel>Properties tab.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also: EloGetScreenInfo, Sample and Error Codes

### Function Name: EloGetQuickTouch

int EloGetQuickTouch (PQUICK_TOUCH pQTouch, UINT nScrNo)

Parameters:
pQTouch [out]: Pointer to QUICK_TOUCH structure to receive the quick touch configuration data from the selected touchscreen. Please see structure definition section for QUICK_TOUCH.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSucces if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Gets the Quick Touch configuration parameters for the specified touchscreen.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also EloSetQuickTouch, EloGetScreenInfo, Sample and Error Codes

### Function Name: EloSetQuickTouch

int EloSetQuickTouch (PQUICK_TOUCH pQTouch, UINT nScrNo)

Parameters:
pQTouch [in]: Pointer to QUICK_TOUCH structure containing the quick touch configuration data for the touchscreen. Please see structure definition section for QUICK_TOUCH.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Sets the Quick Touch configuration parameters for all touchscreens.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also EloGetQuickTouch EloGetScreenInfo, Sample and Error Codes

### Function Name: EloGetEdgeAccel

int EloGetEdgeAccel(PEDGE_ACCEL pAccel, UINT nScrNo)

Parameters:
pAccel [out]: Pointer to EDGE_ACCEL structure to receive the edge accleration data for the touchscreen. Please see structure definition section for EDGE_ACCEL.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Gets the edge acceleration boundary and acceleration value for the given touchscreen.

Requirements
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also EloGetScreenInfo, EloSetEdgeAccel, Sample and Error Codes

### Function Name: EloSetEdgeAccel

int EloSetEdgeAccel(PEDGE_ACCEL pAccel, UINT nScrNo)

Parameters:
pAccel [in]: Pointer to EDGE_ACCEL structure to containing the edge accleration data for the touchscreen. Please see structure definition section for EDGE_ACCEL.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Sets the edge acceleration boundary and acceleration scale for the given touchscreen.

Requirements:
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also: EloGetScreenInfo, EloGetEdgeAccel, Sample and Error Codes

### Function Name: EloGetUntouchTimeout

int EloGetUntouchTimeout(PUNTOUCH_TIMEOUT pUTimeout, UINT nScrNo)

Parameters:
pUTimeout [out]: Pointer to UNTOUCH_TIMEOUT structure to receive the untouch timeout data for the touchscreen. Please see structure definition section for UNTOUCH_TIMEOUT.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Gets the untouch timeout data for the given touchscreen.

Requirements:
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also: EloGetScreenInfo, EloSetUntouchTimeout, Sample and Error Codes

### Function Name: EloSetUntouchTimeout

int EloSetUntouchTimeout(PUNTOUCH_TIMEOUT pUTimeout, UINT nScrNo)

Parameters:
pUTimeout [in]: Pointer to UNTOUCH_TIMEOUT structure to containing the untouch timeout data for the touchscreen. Please see structure definition section for UNTOUCH_TIMEOUT.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Sets the untouch timeout for the given touchscreen.

Requirements:
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also: EloGetScreenInfo, EloGetUntouchTimeout, Sample and Error Codes

### Function Name: EloGetRightClickOnHold

int EloGetRightClickOnHold(PRIGHT_BUTTON pRBHold, UINT nScrNo)

Parameters:
pRBHold [out]: Pointer to RIGHT_BUTTON structure to receive the right button on hold data for the touchscreen. The application is responsible for allocating / freeing memory. Please see structure definition section for RIGHT_BUTTON.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Gets the right button on hold data for the given touchscreen.

Requirements:
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also: EloGetScreenInfo, EloSetRightClickOnHold, Sample and Error Codes

### Function Name: EloSetRightClickOnHold

int EloSetRightClickOnHold(PRIGHT_BUTTON pRBHold, UINT nScrNo)

Parameters:
pRBHold [in]: Pointer to RIGHT_BUTTON structure to containing the right button on hold data for the touchscreen. Please see structure definition section for RIGHT_BUTTON.

nScrNo [in]: 0 based touchscreen number.

Return Values: Returns EloSuccess if the call succeeds, it returns an error code otherwise. See Error Codes section for list of error values.

Remarks:
Sets the right button on hold for the given touchscreen.

Requirements:
Included in Version 4.20 and later.
Header: Declared in EloInterface.h; include EloInterface.h.
Library: Use EloPubIf.lib.

See Also: EloGetScreenInfo, EloGetRightClickOnHold, Sample and Error Codes

## Interface Data Structures

### Structure Name: SCREEN_PROPERTIES

The SCREEN_PROPERTIES structure contains the diagnostics data for the touchscreen.
typedef struct _SCREEN_PROPERTIES
{

int iWindowsMonNo ;
ULONG Type;
char Port[256];
char SerialNumber[18];
DWORD HardwareHandshaking ;
CONTRL_STAT ctrl_status;
LONG BaudRate;
char crevminor;
char crevmajor;
char trevminor;
char trevmajor;
char diagcodes[8];
char id[8];
char cnt_id[8];
char driver_id[32];

}SCREEN_PROPERTIES, *LPSCREEN_PROPERTIES ;

Members

iWindowsMonNo: Windows monitor number associated with the touchscreen.

Type: Defines the type of touchscreen. Expected values are

USB: 0x01
PNP_SERIAL: 0x02
NT_SERIAL: 0x04
LEGACY_SERIAL: 0x08
RESERVED: 0xFF

Port:The serial port on which this serial touchscreen device is connected. This is blank for USB.

SerialNumber: Serial number for connected touchscreen. Serial numbers uniquely identify a touchscreen.

HardwareHandshaking: This is used only for serial touchscreens. If it is set to 1 hardware handshaking is turned on else if it is set to 0 it is turned off.

ctrl_status: Controller status returned at the time of diagnostics. Please see constants definition for CONTRL_STAT.

BaudRate: This specifies the baud rate for the serial port, valid only for serial touchscreens.

crevminor: Minor revision of controller.

crevmajor: Major revision of controller.

trevminor: Unused.

trevmajor: Unused.

diagcodes: The response received for the diagnostics smartest command sent to the controller.

id: Elo OEM identification returned from the controller.

cnt_id: Contains the response to controller id smartest command to the controller.

driver_id: Driver identification / version string.

### Structure Name: TOUCH_POINT

The TOUCH_POINT structure defines a touch coordinate.
typedef struct TOUCH_POINT
{

LONG x;

LONG y;

LONG z;

GETPOINTS_STATUS Status ;

}TOUCH_POINT, *PTOUCH_POINT ;

Members
x: x co-ordinate for touch.

y: y co-ordinate for touch.

z: z co-ordinate for touch.

Status: Receives the touch status. Please see constants definition for GETPOINTS_STATUS.

### Structure Name: CALIBRATION

The CALIBRATION structure defines the calibration data used to convert touches from the Elo coordinate system to Windows virtual coordinate system.

The driver uses the following equation to convert a raw touch coordinate point from Elo coordinate system to the Windows screen coordinate system.
Calibration equation is

Xcal = a + m*Xuncal,

where,
Xuncal, is in Elo coordinate system
Xcal, is in Windows coordinate system
m = nScrDx / nEloDx
"a", is the X offset value entry
nScrDx = distance between targets in Windows virtual coordinates
nEloDx = distance between targets in Elo coordinates.

typedef struct _Calibration
{

LONG VDeskMode ;
LONG nScrDx ;
LONG nEloDx ;
LONG nOffsetX ;
LONG nScrDy ;
LONG nEloDy ;
LONG nOffsetY ;
LONG xyswap;
LONG MonitorNumber ;
RegistryOperation CalMode ;
LONG xRes ;
LONG yRes ;
LONG xVirtScrSize ;
LONG yVirtScrSize ;
LONG xVirtScrCoord ;
LONG yVirtScrCoord ;
LONG xMonLocn ;
LONG yMonLocn ;

} CALIBRATION, *PCALIBRATION

Members
VDeskMode: Reserved.

nScrDx:
nEloDx:
nOffsetX:
nScrDy:
nEloDy:
nOffsetY:
Data required by calibration. Use the equation above to calculate these values.

xyswap: Specifies if the touchscreen is rotated 90 degrees or 270 degrees. Set to 1 if touchscreen is rotated 90 degrees or 270 degrees else set to 0.

MonitorNumber: Windows monitor numbers are 1 based.

CalMode: Set to TempWrite if the value does not have to be saved over system reboot. For values to be saved over system reboot set this value to Write. Please see constants definition for RegistryOperation.

xRes: Screen width in pixels.

yRes: Screen height in pixels.

xMonLocn: Monitor location (X) for this monitor on the virtual desktop in pixels.

yMonLocn: Monitor location (Y) for this monitor on the virtual desktop in pixels.

xVirtScrSize: Width in pixels of the windows virtual screen.

yVirtScrSize: Height in pixels of the windows virtual screen.

xVirtScrCoord: Top left X coordinate of the Windows virtual screen.

yVirtScrCoord: Top left Y coordinate of the Windows virtual screen.

### Structure Name: DRAG_DELAY

The DRAG_DELAY structure is used to get or set drag delay.
typedef struct _Drag_Delay{
DWORD MinDragDelay ;
DWORD MaxDragDelay ;
DWORD DragDelay ;
} DRAG_DELAY, *PDRAG_DELAY ;

Members
MinDragDelay:
MaxDragDelay:
Reserved.

DragDelay: Drag delay value in milliseconds.

### Structure Name: BEEP

The BEEP structure is used to get or set beep parameter data.
typedef struct _Beep{
BOOL BeepFlag;
DWORD BeepFreq ;
DWORD BeepTime ;
} SOUND, *PBEEP ;

Members
BeepFlag: If TRUE touchscreen beeps on touch.

BeepFreq: Frequency of beep in Hz.

BeepTime: Duration of beep in milliseconds.

### Structure Name: TOUCH_BOUNDARY

The TOUCH_BOUNDARY structure defines the full screen bounding rectangle and bounding mode for the touchscreen.
typedef struct _Touch_Boundry
{
ClippingBounds Bounds;
LONG ClippingMode;
} TOUCH_BOUNDARY, *PTOUCH_BOUNDARY ;

Members
Bounds: Defines the touch bounding rectangle for the screen. See structure ClippingBounds. For interpretation of these bounds see ClippingMode below.

ClippingMode: Defines the mode for the touchscreen boundary on the virtual desktop. Possible values are as follows:
0: Disable virtual desktop. Touch on all screens will reflect on the primary monitor.
1: Enable virtual desktop. In this mode no individual screen bounds are used for the monitor. Touches toward the edge may generate clicks on adjacent monitors.
2: Enable virtual desktop. Screen bounds are enabled for each monitor. Touches on the screen always generate clicks on the associated monitor. A touch outside the bounding rectangle will cause the cursor to move to a point along the boundary that is nearest to the point of touch.
3: Enable virtual desktop. Screen bounds are enabled for each monitor. Touches on the screen always generate clicks on the associated monitor. Touches outside the bounding rectangle are not sent to the system.

### Structure Name: QUICK_TOUCH

The QUICK_TOUCH data structure defines the Quick touch configuration parameters.
typedef struct _Quick_Touch
{
DWORD bEnable ;
ULONG Dx ;
ULONG Dy ;
} QUICK_TOUCH, *PQUICK_TOUCH;

Members
bEnable: 0 disables quick touch , 1 enables it.

Dx: X distance in pixels. Touches outside this distance will generate quick touches.

Dy: Y distance in pixels. Touches outside this distance will generate quick touches.

### Structure Name: ClippingBounds

The ClippingBounds structure is used to define the bounding rectangle.
typedef struct _ClippingBounds{
ULONG X_Max;
ULONG X_Min;
ULONG Y_Max;
ULONG Y_Min;;
ULONG Z_Max ;
ULONG Z_Min ;
} ClippingBounds, *PClippingBounds ;

Members
X_Min:
Specifies the X coordinate of the upper-left corner of the rectangle in pixels.

Y_Min:
Specifies the Y coordinate of the upper-left corner of the rectangle in pixels.

X_Max:
Specifies the X coordinate of the lower-right corner of the rectangle in pixels.

Y_Max:
Specifies the Y coordinate of the lower-right corner of the rectangle in pixels.

Z_Max:
Z_Min:
Reserved.

### Structure Name: EDGE_ACCEL

The EDGE_ACCEL structure is used to define the bounding rectangle.
typedef struct _ Accel{
ULONG Enable ;
ULONG Scale ;
ClippingBounds Bounds[1] ;
} EDGE_ACCEL, *PEDGE_ACCEL ;

Members
Enable: 0 disables acceleration, 1 enables it.

Scale: Acceleration scale be anywhere in the range of 0-100. 10 indicates no acceleration.

Bounds: Defines the edge of the touchscreen acceleration bounds. See structure ClippingBounds.

### Structure Name: RIGHT_BUTTON

The RIGH_BUTTON structure is used to define the right click on hold feature.
typedef struct _ Right_Button{
DWORD RightClickHW ;
style='color:black;text-decoration: none;text-underline:none'>DWORD InitialTimeout ;
style='color:windowtext; text-decoration:none;text-underline:none'>DWORD DefaultRightClickDelay ;
DWORD MaxRightClickDelay ;
<DWORD MinRightClickDelay ;
ULONG ClickCount;
ULONG Active ;
} RIGHT_BUTTON, *PRIGHT_BUTTON;

Members
RightClickHW: Height and width in pixels defining the area in which right click is valid.

InitialTimeout: The initial timeout after which the cursor changes to the right click cursor.

DefaultRightClickDelay: Right click delay value in milliseconds.

MinRightClickDelay:
MaxRightClickDelay:
Reserved.

ClickCount: Touch count for which the right click on hold feature should be active. A value of 0xffffffff keeps it active for ever. A value of 0 turns it off.

Active: Value of 1 keeps right click on hold active on reboot. Value of 0 turns it off on reboot. This works in combination with ClickCount. To keep it turned on after reboot value for Active should be set to 1 and value for ClickCount should be set to 0xffffffff.

### Structure Name: UNTOUCH_TIMEOUT

The UNTOUCH_TIMEOUT structure is used to define the untouch timeout.
typedef struct _UNTOUCH_TIMEOUT{
ULONG Timeout ;
ULONG Width ;
ULONG Height ;
} UNTOUCH_TIMEOUT, *PUNTOUCH_TIMEOUT ;

Members
Timeout: Untouch timeout value in milliseconds.

Width: Specifies the width in pixels for the screen area within which a constant touch will automatically result in untouch after the Timeout occurs.

Height: Specifies the height in pixels for the screen area within which a constant touch will automatically result in untouch after the Timeout occurs.

### Constants: GETPOINTS_CODE

The blocked call returns data depending on this value.
typedef enum _GETPOINTS_CODE
{
ReturnImmediately=1,
ReturnOnTouch,
ReturnOnUntouch,
ReturnOnNextValidTouch
}GETPOINTS_CODE ;

Values
ReturnImmediately: Returns immediately with the last touch data values. Does not wait for a user to touch the screen.

ReturnOnTouch: Waits for user to touch and then returns data.

ReturnOnUntouch: Waits for user to release touch and then returns data.

ReturnOnNextValidTouch: Waits for the user to touch the screen and returns on the next initial touch, stream touch or untouch event.

### Constants: CONTRL_STAT

Controller status is returned as
typedef enum _CONTRL_STAT
{
CS_OK = 0,
CS_ConstantTouch,
CS_CanNotFindController,
CS_NoResponse,
CS_InvalidResponse,
CS_CanNotSetBaudRate,
CS_CommandNotSent,
CS_SystemError,
CS_InvalidCommPort,
CS_CommPortFailedOpen,
CS_CommPortCommandError,
CS_CommPortNoController,
CS_UndefinedController
} CONTRL_STAT;

Values
CS_OK: Everything works fine.

CS_ConstantTouch: There is constant touch detected on the touchscreen.

CS_CanNotFindController: No controller found.

CS_NoResponse: No response from controller.

CS_InvalidResponse: Incorrect response, maybe due to out of sync.

CS_CanNotSetBaudRate: Baud rate cannot be set.

CS_CommandNotSent: Smartset command could not be sent to the controller.

CS_SystemError: System Error.

CS_InvalidCommPort: No touchscreen connected on the serial port specified.

CS_CommPortFailedOpen: Error opening serial port.

CS_CommPortCommandError: Communications error.

CS_CommPortNoController: No controller.

CS_UndefinedController: Unidentified controller.

### Constants: RegistryOperation

Driver writes the values to the registry if Write flag is set else it initializes the local buffer and does not save it to the registry.
typedef enum
{
TempWrite=1,
Write
}RegistryOperation;

Values
TempWrite: Writes data to local buffer. Does not write it to the registry.

Write: Writes data to local buffer and registry.

### Constants: TOUCHSCREEN_MODE

Valid TOUCHSCREEN_MODE for the touchscreen.

#define CLICK_ON_TOUCH | 0
#define CLICK_ON_RELEASE | 1
#define MOUSE_EMULATION | 6

Values

CLICK_ON_TOUCH: Click on touch sends immediately upon touch a mouse down/up message at the point of touch on the touchscreen. The user's finger must be removed from the touchscreen before a new touch at any location will be recognized. The cursor or selected objects CANNOT be "dragged" on the screen in this mode.

CLICK_ON_RELEASE: Click on release sends at the time of release (untouch) a mouse down/up message at the point that the screen was last touched. Dragging across objects on the screen will not highlight or select them unless untouch occurs when the touch is over the object. (Drag and Double-click)

MOUSE_EMULATION: Sends a mouse down message at the point of contact. Selects an object if it was at the initial point of contact. Drags a selected object on the screen. Sends a mouse up message at the point of untouch. Double-clicks on an object when the screen is touched twice in succession at the same location.

### Constants: GETPOINTS_STATUS

Valid mode for the touchscreen.

typedef enum _GETPOINTS_STATUS |
InitialTouch = | 1,
StreamTouch= | 2,
UnTouch = | 4
GETPOINTS_STATUS; |

Values

InitialTouch: The touch data was returned on initial touch.

StreamTouch: The touch data was returned on stream touch.

UnTouch: The touch data was returned on untouch.

## Error Codes: Returned from the Interface DLL

> > #define EloSuccess | 0
> > #define EloFailure | 1
> > #define EloErrorInIoctl | 2
> > #define EloErrorCallWasCancelled | 3
> > #define EloErrorInvalidTouchScreen | 4
> > #define EloErrorInvalidMonitorNo | 5
> > #define EloErrorInvalidBuffer | 6
> > #define EloErrorInvalidHandle | 7
> > #define EloErrorNoDriver | 8
> > #define EloErrorInvalidCommand | 10
> > #define EloErrorVersionLock | 11
> > #define EloErrorBufferSize | 12
> > #define EloErrorTouchDeviceNotWorking | 13
> > #define EloErrorTouchScreenNumberInvalid | 14
> > #define EloErrorNoMoreTouchScreens | 15
> > #define EloErrorInvalidScreenNumber | 16
> > #define EloErrorUnknown | 17
> > #define EloErrorNotImplemented | 18
> > #define EloErrorDeviceBusy | 19
> > #define EloErrorIncompatibleVersion | 20