Touch screen driver under WinCE

Source: Internet
Author: User
Tags bitmask
Microsoft Corporation. Last updated on Tuesday, May 18,200 4 Touch screen driver SamplesSample Code for touch screen drivers is provided in the following directories:
  • % _ Winceroot %/platform/xsc1bd/Drivers/touchp
  • % _ Winceroot %/public/common/oak/Drivers/touch
Touch screen drivers

The Touch Screen driver reads user input from touch screen hardware and converts it to touch events that are sent to the graphics, drawing wing, and events subsystem (GWES ). the driver also converts uncalibrated coordinates to calibrated coordinates. calibrated coordinates compensate for any hardware anomalies, such as skew or nonlinear sequences.

For the touch screen driver to work properly it must submit points while the user's finger or stylus is touching the touch screen. when the user's finger or stylus is removed from the screen, the driver must submit at least one final event indicating that the user's finger or stylus tip was removed. the calibrated coordinates must be reported to the nearest one-quarter of a pixel.

The following steps detail the basic algorithm that you, the driver developer, can use to sample and calibrate the screen with the touch screen DRIVER:

  1. Call the touchpanelenable function to start the screen sampling.
  2. Call the touchpanelgetdevicecaps function to request the number of sampling points.
  3. For every calibration point, perform the following steps:
    1. Call touchpanelgetdevicecaps to get a calibration coordinate.
    2. Draw a crosshair at the returned coordinate.
    3. Call the touchpanelreadcalibrationpoint function to get calibration data.
  4. Call the touchpanelsetcalibration function to calculate the calibration coefficients.

After the touch screen driver executes this sequence, any finger or stylus samples generated for the screen are passed to the callback function specified inTouchpanelenable. The driver may pass either calibrated or uncalibrated points to the callback. if the driver has an efficient calibration algorithm, it can return calibrated points. however, if the calibration is computationally intensive, the driver may choose to return uncalibrated points, rather than perform extensive calculations in the high-priority driver thread. the lower priority thread processing points from the callback can then perform the calibration.

You can calibrate the screen without an enter key. The default calibration code between des a routine calledUseenteresc. This routine callthe getkeyboardstatus function to determine whether a keyboard is present, enabled, and supports the enter and ESC keys. if so, it prompts the user to use the keyboard to complete the calibration routine. if not, the user is prompted to tap the screen to complete calibration.

Internally, the GWES keyboard code opensHKEY_LOCAL_MACHINE/hardware/devicemap/keybdAnd searches forDWORDValue calledStatus. This is a bitmask combining the kbdi_keyboard_xxx values from % _ winceroot %/public/common/SDK/INC/keybd. H. IfStatusIs not found, GWES uses kbdi_keyboard_present | kbdi_keyboard_enter_esc | kbdi_keyboard_alpha_num. this registry access only occurs once, when the keyboard driver is loaded. this bitmask is the basis for what you get when you call getkeyboardstatus. GWES adds or subtracts the kbdi_keyboard_enabled bit based on callto the enablehardwarekeyboard function. the kbdi_keyboard_enabled bit is set when the keyboard driver is loaded.

When you setStatusRegistry Value, OEMs can then control the type of prompting users get during calibration. if a registry update is not flexible enough for an OEM's platform, the calibration code in % _ winceroot %/public/common/oak/Drivers/calibrui can be modified as appropriate.

The following table shows the touch screen driver functions.

Function Description
Ddsitouchpanelattach Called when the Model Device Driver's (MDD) DLL entry point gets a dll_process_attach message.
Ddsitouchpaneldetach Called when the MDD's dll entry point gets a dll_process_detach message.
Ddsitouchpaneldisable Disables the touch screen device.
Ddsitouchpanelenable Applies power to the touch screen device and initializes it for operation.
Ddsitouchpanelgetdevicecaps Queries for capabilities of the touch screen device.
Ddsitouchpanelgetpoint Returns the most recently acquired point and its associated tip-state information.
Ddsitouchpanelpowerhandler Indicates to the driver that the system is entering or leaving the suspend state.
Ddsitouchpanelsetmode Sets information about the touch screen device.
Erroranalysis Provides information on the accuracy of the touch screen calibration.
Touchpanelcalibrateapoint Converts uncalibrated points to calibrated points.
Touchpaneldisable Disables the touch screen.
Touchpanelenable Enables and re-enables the touch screen.
Touchpanelgetdevicecaps Returns information about the capabilities of the touch screen.
Touchpanelinitializecursor This function provides an opportunity for touch drivers to move the cursor at initialization time.
Touchpanelpowerhandler Handles power-state change configurations.
Touchpanelreadcalibrationabort Aborts the currently active call toTouchpanelcalibrateapointFunction.
Touchpanelreadcalibrationpoint Initiates the process of getting a calibration point.
Touchpanelsetcalibration Initializes calibration information inVcalcparamGlobal parameter.
Touchpanelsetmode Sets mode information for a touch screen device.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.