Android supports a variety of touch screens and touch pads, including stylus-based digitizer tablets. Show
Touch screens are touch devices that are associated with a display such that the user has the impression of directly manipulating items on screen. Touch pads are touch devices that are not associated with a display such as a digitizer tablet. Touch pads are typically used for pointing or for absolute indirect positioning or gesture-based control of a user interface. Touch devices may have buttons whose functions are similar to mouse buttons. Touch devices can sometimes be manipulated using a variety of different tools such as fingers or a stylus depending on the underlying touch sensor technology. Touch devices are sometimes used to implement virtual keys. For example, on some Android devices, the touch screen sensor area extends beyond the edge of the display and serves dual purpose as part of a touch sensitive key pad. Due to the great variety of touch devices, Android relies on a large number of configuration properties to describe the characteristics and desired behavior of each device. Touch Device ClassificationAn input device is classified as a multi-touch device if both of the following conditions hold:
An input device is classified as a single-touch device if both of the following conditions hold:
Once an input device has been classified as a touch device, the presence of virtual keys is determined by attempting to load the virtual key map file for the device. If a virtual key map is available, then the key layout file for the device is also loaded. Refer to the section below about the location and format of virtual key map files. Next, the system loads the input device configuration file for the touch device. All built-in touch devices should have input device configuration files. If no input device configuration file is present, the system will choose a default configuration that is appropriate for typical general-purpose touch peripherals such as external USB or Bluetooth HID touch screens or touch pads. These defaults are not designed for built-in touch screens and will most likely result in incorrect behavior. After the input device configuration loaded, the system will classify the input device as a touch screen, touch pad or pointer device.
The following rules are used to classify the input device as a touch screen, touch pad or pointer device.
ButtonsButtons are optional controls that may be used by applications to perform additional functions. Buttons on touch devices behave similarly to mouse buttons and are mainly of use with pointer type touch devices or with a stylus. The following buttons are supported:
A tool is a finger, stylus or other apparatus that is used to interact with the touch device. Some touch devices can distinguish between different types of tools. Elsewhere in Android, as in the The following tool types are supported:
Tools can either be in contact with the touch device or in range and hovering above it. Not all touch devices are able to sense the presence of a tool hovering above the touch device. Those that do, such as RF-based stylus digitizers, can often detect when the tool is within a limited range of the digitizer. The Touching
tools are reported to applications as touch events using Hovering tools are reported to applications as generic motion events using Touch Device Driver Requirements
Touch Device OperationThe following is a brief summary of the touch device operation on Android.
Touch Device ConfigurationTouch device behavior is determined by the device's axes, buttons, input properties, input device configuration, virtual key map and key layout. Refer to the following sections for more details about the files that participate in keyboard configuration:
PropertiesThe system relies on many input device configuration properties to configure and calibrate touch device behavior. One reason for this is that the device drivers for touch devices often report the characteristics of touches using device-specific units. For example, many touch devices measure the touch contact area using an internal device-specific scale, such as the total number of sensor nodes that were triggered by the touch. This raw size value would not be meaningful to applications because they would need to know about the physical size and other characteristics of the touch device sensor nodes. The system uses calibration parameters encoded in input device configuration files to decode, transform, and normalize the values reported by the touch device into a simpler standard representation that applications can understand. Documentation ConventionsFor documentation purposes, we will use the following conventions to describe the values used by the system during the calibration process. Raw Axis ValuesThe following expressions denote the raw values reported by the touch device driver as raw.x The value of the ABS_X or ABS_MT_POSITION_X axis.raw.y The value of the ABS_Y or ABS_MT_POSITION_Y axis.raw.pressure The value of the ABS_PRESSURE or ABS_MT_PRESSURE axis, or 0 if not available.raw.touchMajor The value of the ABS_MT_TOUCH_MAJOR axis, or 0 if not available.raw.touchMinor
The value of the ABS_MT_TOUCH_MINOR axis, or raw.touchMajor if not available.raw.toolMajor The value of the ABS_TOOL_WIDTH or ABS_MT_WIDTH_MAJOR axis, or 0 if not available.raw.toolMinor The value of the ABS_MT_WIDTH_MINOR axis, or raw.toolMajor if not available.raw.orientation The value of the ABS_MT_ORIENTATION axis, or 0 if not available.raw.distance The value of the ABS_DISTANCE or ABS_MT_DISTANCE axis, or 0 if not available.raw.tiltX The value of the ABS_TILT_X axis, or 0 if not
available.raw.tiltY The value of the ABS_TILT_Y axis, or 0 if not available.Raw Axis RangesThe following expressions denote the bounds of raw values. They are obtained by calling raw.*.min The inclusive minimum value of the raw axis.raw.*.max The inclusive maximum value of the raw axis.raw.*.range Equivalent to raw.*.max - raw.*.min .raw.*.fuzz
The accuracy of the raw axis. eg. fuzz = 1 implies values are accurate to +/- 1 unit.raw.width The inclusive width of the touch area, equivalent to raw.x.range + 1 .raw.height The inclusive height of the touch area, equivalent to raw.y.range + 1 .Output RangesThe following expressions denote the characteristics of the output coordinate system. The system uses linear interpolation to translate touch position information from the surface units used by the touch device into the output units that will be reported to applications such as display pixels. output.width The output width. For touch screens (associated with a display), this is the display width in pixels. For touch pads (not associated with a display), the output width equals raw.width , indicating that no interpolation will be performed.output.height The output height. For touch screens (associated with a display),
this is the display height in pixels. For touch pads (not associated with a display), the output height equals raw.height , indicating that no interpolation will be performed.output.diag The diagonal length of the output coordinate system, equivalent to sqrt(output.width ^2 + output.height ^2) .Basic ConfigurationThe touch input mapper uses many configuration properties in the input device configuration file to specify calibration values. The following table describes some general purpose configuration properties. All other properties are described in the following sections along with the fields they are used to calibrate.
|