EloIntf.dll provides a common interface for communicating with the Elo Serial and USB drivers. In order to, communicate with the either of the drivers load this dynamic library with your application and use the appropriate interface in your program.
All applications using this library must first call the EloIF_EnumTouchScreenEx function to initialize the DLL.
Please refer to the Appendix
C, EnableDisable Sample Code for interface usage.
Function Name: EloIF_EnumTouchScreenEx
int EloIF_EnumTouchScreenEx(DWORD dwMonNum[32])
Parameters:
dwMonNum: Array of DWORD to receive the Windows monitor number associated with the touchscreens.Return Values: Returns the total number of Elo touchscreens found. Returns EloFailure if no driver is found.
Remarks:
Enumerates and initializes all Elo Serial and USB devices.This must be the first call made to the DLL to enumerate and initialize the touchscreens.
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.
Maximum of 32 touchscreens are supported.
Function Name: EloIF_GetTouch
int EloIF_GetTouch (int nScrNo,TOUCHPOINT* xy, BOOL xlated, GETPOINTS_CODE getCode)
Parameters:
nScrNo: 0 based touchscreen number.xy: Pointer to TOUCHPOINT structure to receive the touch coordinates from the touchscreen. The application is responsible for allocating / freeing memory. Please see structure definition section for TOUCHPOINT.
xlated: If TRUE, the coordinates are returned translated for Windows coordinate system. If FALSE, raw coordinate data are returned.
getCode: This can be one of the following values: ReturnImmediately, ReturnOnTouch, ReturnOnUntouch, ReturnOnNextValidTouch. Please see definition for GETPOINTS_CODE.
Return Values: Returns the touchscreen number for the touchscreen touched. Returns EloFailure if the call fails.
Remarks:
This is a blocking call used to get the touch coordinates for touch. This call does not return until user touches the screen specified.To cancel the blocking wait use EloIF_Cancel API function.
Function Name: EloIF_Cancel
void EloIF_Cancel()
Parameters:
None.Return Values: None.
Remarks:
Cancels any pending request with the driver. Typically used to cancel a blocking call made to the driver.Function Name: EloIF_GetMouseMode
BOOL EloIF_GetMouseMode (WORD *wMode,UINT nScrNo)
Parameters:
wMode: Returns the touchscreen mode. Please see Constant definition section for Mode.nScrNo: 0 based touchscreen number.
Return Values: Returns TRUE if the call succeeds else returns FALSE.
Remarks:
Retrieves the touch mode for the specified touchscreen.Function Name: EloIF_SetMouseMode
BOOL EloIF_SetMouseMode (WORD wMode)
Parameters:
wMode: Touchscreen mode. Please see Constant definition section for Mode.Return Values: Returns TRUE if the call succeeds else returns FALSE.
Remarks:
Sets the touch mode for all touchscreens to wMode.Function Name: EloIF_GetTouchState
void EloIF_GetTouchState (BOOL *bFlag , UINT tsNumber)
Parameters:
bFlag : Touch state enabled / disabled.tsNumber: 0 based touchscreen number.
Return Values: None.
Remarks:
Gets the touch state for touchscreen specified. It saves it in bFlag.
If bFlag is TRUE the touchscreen is disabled else it is enabled.Function Name: EloIF_DisableTouchEx
void EloIF_DisableTouchEx (BOOL bFlag, int iScrNo)
Parameters:
bFlag : Touch state enabled / disabled.iScrNo: 0 based touchscreen number.
Return Values: None
Remarks:
Enables or Disables touch depending on bFlag. If bFlag is TRUE the touchscreen is disabled else it is enabled.If iScrNo is -1 then touch state is changed for all touchscreen.
Function Name: EloIF_GetDragDelay
BOOL EloIF_GetDragDelay (PDRAGDELAYDATA dwDragDelay,UINT nScrNo)
Parameters:
dwDragDelay: Pointer to DRAGDELAYDATA to receive Drag Delay . Please see structure definition section for PDRAGDELAYDATA.nScrNo: 0 based touchscreen number.
Return Values: Returns TRUE if the call succeeds else returns FALSE.
Remarks:
Gets the dragdelay parameters for the specified touchscreen.Function Name: EloIF_SetDragDelay
BOOL EloIF_SetDragDelay (DRAGDELAYDATA DragDelay)
Parameters:
DragDelay: Dragdelay data. Please see structure definition section for DRAGDELAYDATA.Return Values: Returns TRUE if the call succeeds else returns FALSE.
Remarks:
Sets the drag delay for all touchscreens.Function Name: EloIF_GetSound
BOOL EloIF_GetSound (PSOUNDDATA sndVal, UINT nScrNo)
Parameters:
sndVal: Pointer to SOUNDDATA structure to receive data. The application is responsible for allocating / freeing memory. Please see structure definition section for SOUNDDATA.nScrNo: 0 based touchscreen number.
Return Values: Returns TRUE if the call succeeds else returns FALSE.
Remarks:
Gets the touchscreen beep data for the specified touchscreen.Function Name: EloIF_SetSound
BOOL EloIF_SetSound (PSOUNDDATA sndVal)
Parameters:
sndVal: Pointer to sound structure to receive data. The application is responsible for allocating / freeing memory. Please see structure definition section for SOUNDDATA definition.Return Values: Returns TRUE if the call succeeds else returns FALSE.
Remarks:
Sets the touchscreen beep data for all touchscreens.Function Name: EloIF_GetVirtualFullScreen
BOOL EloIF_GetVirtualFullScreen (PFULLSCREEN pFullScreen)
Parameters:
pFullScreen: Pointer to FULLSCREEN structure containing full screen boundary data in pixels. The application is responsible for allocating / freeing memory. Please see structure definition section for FULLSCREEN.Return Values: Returns TRUE if the call succeeds else returns FALSE.
Remarks:
Gets the full screen bounding rectangle and bounding mode for the specified touchscreen.Function Name: EloIF_SetVirtualFullScreen
BOOL EloIF_SetVirtualFullScreen (PFULLSCREEN pFullScreen)
Parameters:
pFullScreen: Pointer to FULLSCREEN structure containing full screen boundary data in pixels. The application is responsible for allocating / freeing memory. Please see structure definition section for FULLSCREEN.Return Values: Returns TRUE if the call succeeds else returns FALSE.
Remarks:
Sets the full screen bounding rectangle and bounding mode for the specified touchscreen.Function Name: EloIF_GetCalibrationData
DWORD EloIF_GetCalibrationData (CalibData *pCalData, DWORD dwScrNo)
Parameters:
pCalData: Pointer to CalibData structure to receive the calibration data. The application is responsible for allocating / freeing memory. Please see structure definition section for CalibData.dwScrNo: 0 based touchscreen number.
Return Values: Returns EloSuccess if the call succeeds else returns EloFailure.
Remarks:
Retrieves the calibration data for the specified touchscreen.Function Name: EloIF_UpdateCalibrationData
BOOL EloIF_UpdateCalibrationData (CalibData *pCalData,DWORD nScrNo)
Parameters:
pCalData: Pointer to CalibData structure which stores the calibration data for the touchscreen. The application is responsible for allocating / freeing memory. Please see structure definition section for CalibData.nScrNo: 0 based touchscreen number.
Return Values: Returns TRUE if the call succeeds else returns FALSE.
Remarks:
Sets the calibration data for the specified touchscreen.Function Name: EloIF_SwapButton
BOOL EloIF_SwapButton (HWND hWnd,DWORD dwScrNo,DWORD dwCnt)
Parameters:
hWnd: Handle to window to receive the WM_RELEASEBUTTON message.dwScrNo: 0 based touchscreen number.
dwCnt: Touch count for which the button should be swapped.
Return Values: Returns TRUE if the call succeeds else returns FALSE.
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 WM_RELEASEBUTTON message to application window specified in hWnd.WM_RELEASEBUTTON must be defined in the user application as Windows user defined message of value WM_USER + 4698.
Function Name: EloIF_SetLeftHandedMouse
int EloIF_SetLeftHandedMouse (BOOL bFlag)
Parameters:
bFlag: If TRUE it sets touchscreen mode to left-handed mouse.Return Values: Returns EloSuccess if the call succeeds else returns EloFailure.
Remarks:
Sets the touchscreen mode to left-handed mouse. This does not affect the Windows left-handed mouse settings.Function Name: EloIF_GetDiagnosticsData
BOOL EloIF_GetDiagnosticsData(LPPROPERTIESDATA pData, int nScrNo)
Parameters:
pData: Pointer to PROPERTIESDATA structure to receive the diagnostics for the touchscreen. The application is responsible for allocating / freeing memory.
Please see structure definition section for PROPERTIESDATA.nScrNo: 0 based touchscreen number.
Return Values: Returns TRUE if the call succeeds else it returns FALSE.
Remarks:
Gets the diagnostics for the specified touchscreen. This information is also displayed in the Elo Control panel>Properties tab.Function Name: EloIF_GetQuickTouch
int EloIF_GetQuickTouch (PQUICK_TOUCH_DATA pQTouch, UINT nScrNo)
Parameters:
pQTouch: Pointer to QUICK_TOUCH_DATA structure to receive the quick touch configuration data from the selected touchscreen. The application is responsible for allocating / freeing memory. Please see structure definition section for QUICK_TOUCH_DATA.nScrNo: 0 based touchscreen number.
Return Values: Returns EloSuccess if the call succeeds else returns EloFailure.
Remarks:
Gets the Quick Touch configuration parameters.Function Name: EloIF_SetQuickTouch
int EloIF_SetQuickTouch (PQUICK_TOUCH_DATA pQTouch)
Parameters:
pQTouch: Pointer to QUICK_TOUCH_DATA structure containing the quick touch configuration data for the touchscreen. The application is responsible for allocating / freeing memory. Please see structure definition section for QUICK_TOUCH_DATA.Return Values: Returns EloSuccess if the call succeeds else returns EloFailure.
Remarks:
Sets the Quick Touch configuration parameters for all touchscreens.Function Name: EloIF_GetAcceleration
int EloIF_GetAcceleration(PACCELDATA pAccel)
Parameters:
pAccel: Pointer to ACCELDATA structure to receive the edge accleration data for the touchscreen. The application is responsible for allocating / freeing memory. Please see structure definition section for ACCELDATA.Return Values: Returns EloSuccess if the call succeeds else returns EloFailure.
Remarks:
Gets the edge acceleration boundary and acceleration value for the given touchscreen.Function Name: EloIF_SetAcceleration
int EloIF_SetAcceleration(PACCELDATA pAccel)
Parameters:
pAccel: Pointer to ACCELDATA structure to containing the edge accleration data for the touchscreen. The application is responsible for allocating / freeing memory. Please see structure definition section for ACCELDATA.Return Values: Returns EloSuccess if the call succeeds else returns EloFailure.
Remarks:
Sets the edge acceleration boundary and acceleration scale for the given touchscreen.
Structure Name: PROPERTIESDATA
The PROPERTIESDATA structure contains the diagnostics data for the touchscreen.
typedef struct _PropertiesData
{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];}PROPERTIESDATA, *LPPROPERTIESDATA ;
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: 0xFFPort: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: TOUCHPOINT
The TOUCHPOINT structure defines a touch coordinate.
typedef struct tagTOUCHPOINT
{LONG x;
LONG y;
LONG z;
}TOUCHPOINT, *LPTOUCHPOINT ;Members
x: x co-ordinate for touch.y: y co-ordinate for touch.
z: z co-ordinate for touch.
Structure Name: CalibData
The CalibData 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 isXcal = 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 _CalibData
{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 xMonLocn ;
LONG yMonLocn ;
LONG xVirtScrSize ;
LONG yVirtScrSize ;
LONG xVirtScrCoord ;
LONG yVirtScrCoord ;} CalibData;
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.
yMonLocn: Monitor location (Y) for this monitor on the virtual desktop.
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: DRAGDELAYDATA
The DRAGDELAYDATA structure is used to get or set drag delay. typedef struct _DragDelayData{
DWORD MinDragDelay ;
DWORD MaxDragDelay ;
DWORD DragDelay ;
} DRAGDELAYDATA, *PDRAGDELAYDATA ; Members
MinDragDelay:
MaxDragDelay:
Reserved.DragDelay: Drag delay value in milliseconds.
Structure Name: SOUNDDATA
The SOUNDDATA structure is used to get or set beep parameter data. typedef struct _SoundData{
BOOL BeepFlag;
DWORD BeepFreq ;
DWORD BeepTime ;
} SOUNDDATA, *PSOUNDDATA ;
Members
BeepFlag: If TRUE touchscreen beeps on touch.BeepFreq: Frequency of beep in Hz.
BeepTime: Duration of beep in milliseconds.
Structure Name: FULLSCREEN
The FULLSCREEN structure defines the full screen bounding rectangle and bounding mode for the touchscreen. typedef struct _FullScreen
{
LONG ScreenNumber ;
ClippingBounds Bounds;
LONG ClippingMode;
} FULLSCREEN, *PFULLSCREEN ;
Members
ScreenNumber: 0 based touchscreen number.Bounds: Defines the full screen 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_DATA
The QUICK_TOUCH_DATA data structure defines the Quick touch configuration parameters. typedef struct _QuickTouchData
{
DWORD bEnable ;
ULONG Dx ;
ULONG Dy ;
} QUICK_TOUCH_DATA, *PQUICK_TOUCH_DATA;
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_Min ;
ULONG Y_Min ;
ULONG X_Max ;
ULONG Y_Max ;
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: ACCELDATA
The ClippingBounds structure is used to define the bounding rectangle. typedef struct _ ACCELDATA{
LONG ScreenNumber ;
ULONG Enable ;
ULONG Scale ;
ClippingBounds Bounds[1] ;
} ACCELDATA, *PACCELDATA ;
Members
ScreenNumber: 0 based touchscreen number.
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.
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: Mode
Valid 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.
Error codes: Returned from the Interface DLL
EloSuccess: 0 EloFailure: -1