android中如何设计触摸屏驱动touch screen driver

ESP32-S2 HMI开发板实战:从驱动屏幕到LVGL界面开发 嵌入式人机界面(HMI)设计常面临硬件选型与图形渲染的双重挑战。基于ESP32-S2芯片的开发套件,凭借丰富的外设接口与低成本优势,成为快速构建显示终端的理想选择。文章从HMI系统的基本构成出发,解析SPI/RGB屏驱动原理、触摸校准机制,以及LVGL图形库在资源受限环境下的优化技巧。通过工业控制面板、智能家居中控等真实场景,对比ESP32与S3的选型差异,并给出从环境搭建到工程落地的完整路径。最后结合常见花屏、触摸偏移等问题的排查经验,帮助开发者高效实现从驱动到交互界面的端到端设计。 阅读详情

以下内容是来自android官方的文档,详细说明了android上层关心的event事件,如果要做一个好的TP驱动,这些信息是必须清楚的,另外现在的android2.3已经完全支持了virtualkey,如果要使用虚拟按键的话,这篇文章里面也详细作出了说明。总之,这是最有价值的文档!

我先复制过来了,等我有空了翻译翻译。。。

原文出自:

http://source.android.com/tech/input/touch-devices.html



Touch Devices

Android supports a variety of touch screens and touch pads, including stylus-based digitizer tablets.

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 Classification

An input device is classified as a multi-touch device if both of the following conditions hold:

  • The input device reports the presence of the ABS_MT_POSITION_X and ABS_MT_POSITION_Y absolute axes.

  • The input device does not have any gamepad buttons. This condition resolves an ambiguity with certain gamepads that report axes with codes that overlaps those of the MT axes.

An input device is classified as a single-touch device if both of the following conditions hold:

  • The input device is not classified as a multi-touch device. An input device is either classified as a single-touch device or as a multi-touch device, never both.

  • The input device reports the presence of the ABS_X and ABS_Y absolute axes, and the presence of the BTN_TOUCH key code.

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.

  • A touch screen device is used for direct manipulation of objects on the screen. Since the user is directly touching the screen, the system does not require any additional affordances to indicate the objects being manipulated.

  • A touch pad device is used to provide absolute positioning information to an application about touches on a given sensor area. It may be useful for digitizer tablets.

  • A pointer device is used for indirect manipulation of objects on the screen using a cursor. Fingers are interpreted as multi-touch pointer gestures. Other tools, such as styluses, are interpreted using absolute positions.

    See Indirect Multi-touch Pointer Gestures for more information.

The following rules are used to classify the input device as a touch screen, touch pad or pointer device.

  • If the touch.deviceType property is set, then the device type will be set as indicated.

  • If the input device reports the presence of the INPUT_PROP_DIRECT input property (via the EVIOCGPROP ioctl), then the device type will be set to touch screen. This condition assumes that direct input touch devices are attached to a display that is also connected.

  • If the input device reports the presence of the INPUT_PROP_POINTER input property (via the EVIOCGPROP ioctl), then the device type will be set to pointer.

  • If the input device reports the presence of the REL_X or REL_Y relative axes, then the device type will be set to touch pad. This condition resolves an ambiguity for input devices that consist of both a mouse and a touch pad. In this case, the touch pad will not be used to control the pointer because the mouse already controls it.

  • Otherwise, the device type will be set to pointer. This default ensures that touch pads that have not been designated any other special purpose will serve to control the pointer.

Buttons

Buttons 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 withpointer type touch devices or with a stylus.

The following buttons are supported:

  • BTN_LEFT: mapped to MotionEvent.BUTTON_PRIMARY.

  • BTN_RIGHT: mapped to MotionEvent.BUTTON_SECONDARY.

  • BTN_MIDDLE: mapped to MotionEvent.BUTTON_MIDDLE.

  • BTN_BACK and BTN_SIDE: mapped to MotionEvent.BUTTON_BACK. Pressing this button also synthesizes a key press with the key code KeyEvent.KEYCODE_BACK.

  • BTN_FORWARD and BTN_EXTRA: mapped to MotionEvent.BUTTON_FORWARD. Pressing this button also synthesizes a key press with the key codeKeyEvent.KEYCODE_FORWARD.

  • BTN_STYLUS: mapped to MotionEvent.BUTTON_SECONDARY.

  • BTN_STYLUS2: mapped to MotionEvent.BUTTON_TERTIARY.

Tools and Tool Types

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 MotionEvent API, a tool is often referred to as a pointer.

The following tool types are supported:

  • BTN_TOOL_FINGER and MT_TOOL_FINGER: mapped to MotionEvent.TOOL_TYPE_FINGER.

  • BTN_TOOL_PEN and MT_TOOL_PEN: mapped to MotionEvent.TOOL_TYPE_STYLUS.

  • BTN_TOOL_RUBBER: mapped to MotionEvent.TOOL_TYPE_ERASER.

  • BTN_TOOL_BRUSH: mapped to MotionEvent.TOOL_TYPE_STYLUS.

  • BTN_TOOL_PENCIL: mapped to MotionEvent.TOOL_TYPE_STYLUS.

  • BTN_TOOL_AIRBRUSH: mapped to MotionEvent.TOOL_TYPE_STYLUS.

  • BTN_TOOL_MOUSE: mapped to MotionEvent.TOOL_TYPE_MOUSE.

  • BTN_TOOL_LENS: mapped to MotionEvent.TOOL_TYPE_MOUSE.

  • BTN_TOOL_DOUBLETAP, BTN_TOOL_TRIPLETAP, and BTN_TOOL_QUADTAP: mapped to MotionEvent.TOOL_TYPE_FINGER.

Hovering vs. Touching Tools

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 InputReader component takes care to distinguish touching tools from hovering tools. Likewise, touching tools and hovering tools are reported to applications in different ways.

Touching tools are reported to applications as touch events using MotionEvent.ACTION_DOWN, MotionEvent.ACTION_MOVE, MotionEvent.ACTION_DOWN,MotionEvent.ACTION_POINTER_DOWN and MotionEvent.ACTION_POINTER_UP.

Hovering tools are reported to applications as generic motion events using MotionEvent.ACTION_HOVER_ENTER, MotionEvent.ACTION_HOVER_MOVE andMotionEvent.ACTION_HOVER_EXIT.

Touch Device Driver Requirements

  1. Touch device drivers should only register axes and key codes for the axes and buttons that they actually support. Registering excess axes or key codes may confuse the device classification algorithm or cause the system to incorrectly detect the capabilities of the device.

    For example, if the device reports the BTN_TOUCH key code, the system will assume that BTN_TOUCH will always be used to indicate whether the tool is actually touching the screen or is merely in range and hovering.

  2. Single-touch devices use the following Linux input events:

    • ABS_X: (REQUIRED) Reports the X coordinate of the tool.

    • ABS_Y: (REQUIRED) Reports the Y coordinate of the tool.

    • ABS_PRESSURE: (optional) Reports the physical pressure applied to the tip of the tool or the signal strength of the touch contact.

    • ABS_TOOL_WIDTH: (optional) Reports the cross-sectional area or width of the touch contact or of the tool itself.

    • ABS_DISTANCE: (optional) Reports the distance of the tool from the surface of the touch device.

    • ABS_TILT_X: (optional) Reports the tilt of the tool from the surface of the touch device along the X axis.

    • ABS_TILT_Y: (optional) Reports the tilt of the tool from the surface of the touch device along the Y axis.

    • BTN_TOUCH: (REQUIRED) Indicates whether the tool is touching the device.

    • BTN_LEFT, BTN_RIGHT, BTN_MIDDLE, BTN_BACK, BTN_SIDE, BTN_FORWARD, BTN_EXTRA, BTN_STYLUS, BTN_STYLUS2: (optional) Reports button states.

    • BTN_TOOL_FINGER, BTN_TOOL_PEN, BTN_TOOL_RUBBER, BTN_TOOL_BRUSH, BTN_TOOL_PENCIL, BTN_TOOL_AIRBRUSH, BTN_TOOL_MOUSE, BTN_TOOL_LENS,BTN_TOOL_DOUBLETAP, BTN_TOOL_TRIPLETAP, BTN_TOOL_QUADTAP: (optional) Reports the tool type.

  3. Multi-touch devices use the following Linux input events:

    • ABS_MT_POSITION_X: (REQUIRED) Reports the X coordinate of the tool.

    • ABS_MT_POSITION_Y: (REQUIRED) Reports the Y coordinate of the tool.

    • ABS_MT_PRESSURE: (optional) Reports the physical pressure applied to the tip of the tool or the signal strength of the touch contact.

    • ABS_MT_TOUCH_MAJOR: (optional) Reports the cross-sectional area of the touch contact, or the length of the longer dimension of the touch contact.

    • ABS_MT_TOUCH_MINOR: (optional) Reports the length of the shorter dimension of the touch contact. This axis should not be used if ABS_MT_TOUCH_MAJOR is reporting an area measurement.

    • ABS_MT_WIDTH_MAJOR: (optional) Reports the cross-sectional area of the tool itself, or the length of the longer dimension of the tool itself. This axis should not be used if the dimensions of the tool itself are unknown.

    • ABS_MT_WIDTH_MINOR: (optional) Reports the length of the shorter dimension of the tool itself. This axis should not be used if ABS_MT_WIDTH_MAJOR is reporting an area measurement or if the dimensions of the tool itself are unknown.

    • ABS_MT_ORIENTATION: (optional) Reports the orientation of the tool.

    • ABS_MT_DISTANCE: (optional) Reports the distance of the tool from the surface of the touch device.

    • ABS_MT_TOOL_TYPE: (optional) Reports the tool type as MT_TOOL_FINGER or MT_TOOL_PEN.

    • ABS_MT_TRACKING_ID: (optional) Reports the tracking id of the tool. The tracking id is an arbitrary non-negative integer that is used to identify and track each tool independently when multiple tools are active. For example, when multiple fingers are touching the device, each finger should be assigned a distinct tracking id that is used as long as the finger remains in contact. Tracking ids may be reused when their associated tools move out of range.

    • ABS_MT_SLOT: (optional) Reports the slot id of the tool, when using the Linux multi-touch protocol 'B'. Refer to the Linux multi-touch protocol documentation for more details.

    • BTN_TOUCH: (REQUIRED) Indicates whether the tool is touching the device.

    • BTN_LEFT, BTN_RIGHT, BTN_MIDDLE, BTN_BACK, BTN_SIDE, BTN_FORWARD, BTN_EXTRA, BTN_STYLUS, BTN_STYLUS2: (optional) Reports button states.

    • BTN_TOOL_FINGER, BTN_TOOL_PEN, BTN_TOOL_RUBBER, BTN_TOOL_BRUSH, BTN_TOOL_PENCIL, BTN_TOOL_AIRBRUSH, BTN_TOOL_MOUSE, BTN_TOOL_LENS,BTN_TOOL_DOUBLETAP, BTN_TOOL_TRIPLETAP, BTN_TOOL_QUADTAP: (optional) Reports the tool type.

  4. If axes for both the single-touch and multi-touch protocol are defined, then only the multi-touch axes will be used and the single-touch axes will be ignored.

  5. The minimum and maximum values of the ABS_X, ABS_Y, ABS_MT_POSITION_X and ABS_MT_POSITION_Y axes define the bounds of the active area of the device in device-specific surface units. In the case of a touch screen, the active area describes the part of the touch device that actually covers the display.

    For a touch screen, the system automatically interpolates the reported touch positions in surface units to obtain touch positions in display pixels according to the following calculation:

    displayX = (x - minX) * displayWidth / (maxX - minX + 1)
    displayY = (y - minY) * displayHeight / (maxY - minY + 1)
    

    A touch screen may report touches outside of the reported active area.

    Touches that are initiated outside the active area are not delivered to applications but may be used for virtual keys.

    Touches that are initiated inside the active area, or that enter and exit the display area are delivered to applications. Consequently, if a touch starts within the bounds of an application and then moves outside of the active area, the application may receive touch events with display coordinates that are negative or beyond the bounds of the display. This is expected behavior.

    A touch device should never clamp touch coordinates to the bounds of the active area. If a touch exits the active area, it should be reported as being outside of the active area, or it should not be reported at all.

    For example, if the user's finger is touching near the top-left corner of the touch screen, it may report a coordinate of (minX, minY). If the finger continues to move further outside of the active area, the touch screen should either start reporting coordinates with components less than minX and minY, such as (minX - 2, minY - 3), or it should stop reporting the touch altogether. In other words, the touch screen should not be reporting (minX, minY) when the user's finger is really touching outside of the active area.

    Clamping touch coordinates to the display edge creates an artificial hard boundary around the edge of the screen which prevents the system from smoothly tracking motions that enter or exit the bounds of the display area.

  6. The values reported by ABS_PRESSURE or ABS_MT_PRESSURE, if they are reported at all, must be non-zero when the tool is touching the device and zero otherwise to indicate that the tool is hovering.

    Reporting pressure information is optional but strongly recommended. Applications can use pressure information to implement pressure-sensitive drawing and other effects.

  7. The values reported by ABS_TOOL_WIDTH, ABS_MT_TOUCH_MAJOR, ABS_MT_TOUCH_MINOR, ABS_MT_WIDTH_MAJOR, or ABS_MT_WIDTH_MINOR should be non-zero when the tool is touching the device and zero otherwise, but this is not required. For example, the touch device may be able to measure the size of finger touch contacts but not stylus touch contacts.

    Reporting size information is optional but strongly recommended. Applications can use pressure information to implement size-sensitive drawing and other effects.

  8. The values reported by ABS_DISTANCE or ABS_MT_DISTANCE should approach zero when the tool is touching the device. The distance may remain non-zero even when the tool is in direct contact. The exact values reported depend on the manner in which the hardware measures distance.

    Reporting distance information is optional but recommended for stylus devices.

  9. The values reported by ABS_TILT_X and ABS_TILT_Y should be zero when the tool is perpendicular to the device. A non-zero tilt is taken as an indication that the tool is held at an incline.

    The tilt angles along the X and Y axes are assumed to be specified in degrees from perpendicular. The center point (perfectly perpendicular) is given by (max + min) / 2 for each axis. Values smaller than the center point represent a tilt up or to the left, values larger than the center point represent a tilt down or to the right.

    The InputReader converts the X and Y tilt components into a perpendicular tilt angle ranging from 0 to PI / 2 radians and a planar orientation angle ranging from -PI to PIradians. This representation results in a description of orientation that is compatible with what is used to describe finger touches.

    Reporting tilt information is optional but recommended for stylus devices.

  10. If the tool type is reported by ABS_MT_TOOL_TYPE, it will supercede any tool type information reported by BTN_TOOL_*. If no tool type information is available at all, the tool type defaults to MotionEvent.TOOL_TYPE_FINGER.

  11. A tool is determined to be active based on the following conditions:

    • When using the single-touch protocol, the tool is active if BTN_TOUCH, or BTN_TOOL_* is 1.

      This condition implies that the InputReader needs to have at least some information about the nature of the tool, either whether it is touching, or at least its tool type. If no information is available, then the tool is assumed to be inactive (out of range).

    • When using the multi-touch protocol 'A', the tool is active whenever it appears in the most recent sync report. When the tool stops appearing in sync reports, it ceases to exist.

    • When using the multi-touch protocol 'B', the tool is active as long as it has an active slot. When the slot it cleared, the tool ceases to exist.

  12. A tool is determined to be hovering based on the following conditions:

    • If the tool is BTN_TOOL_MOUSE or BTN_TOOL_LENS, then the tool is not hovering, even if either of the following conditions are true.

    • If the tool is active and the driver reports pressure information, and the reported pressure is zero, then the tool is hovering.

    • If the tool is active and the driver supports the BTN_TOUCH key code and BTN_TOUCH has a value of zero, then the tool is hovering.

  13. The InputReader supports both multi-touch protocol 'A' and 'B'. New drivers should use the 'B' protocol but either will work.

  14. As of Android Ice Cream Sandwich 4.0, touch screen drivers may need to be changed to comply with the Linux input protocol specification.

    The following changes may be required:

    • When a tool becomes inactive (finger goes "up"), it should stop appearing in subsequent multi-touch sync reports. When all tools become inactive (all fingers go "up"), the driver should send an empty sync report packet, such as SYN_MT_REPORT followed by SYN_REPORT.

      Previous versions of Android expected "up" events to be reported by sending a pressure value of 0. The old behavior was incompatible with the Linux input protocol specification and is no longer supported.

    • Physical pressure or signal strength information should be reported using ABS_MT_PRESSURE.

      Previous versions of Android retrieved pressure information from ABS_MT_TOUCH_MAJOR. The old behavior was incompatible with the Linux input protocol specification and is no longer supported.

    • Touch size information should be reported using ABS_MT_TOUCH_MAJOR.

      Previous versions of Android retrieved size information from ABS_MT_TOOL_MAJOR. The old behavior was incompatible with the Linux input protocol specification and is no longer supported.

    Touch device drivers no longer need Android-specific customizations. By relying on the standard Linux input protocol, Android can support a wider variety of touch peripherals, such as external HID multi-touch touch screens, using unmodified drivers.

Touch Device Operation

The following is a brief summary of the touch device operation on Android.

  1. The EventHub reads raw events from the evdev driver.

  2. The InputReader consumes the raw events and updates internal state about the position and other characteristics of each tool. It also tracks button states.

  3. If the BACK or FORWARD buttons were pressed or released, the InputReader notifies the InputDispatcher about the key event.

  4. The InputReader determines whether a virtual key press occurred. If so, it notifies the InputDispatcher about the key event.

  5. The InputReader determines whether the touch was initiated within the bounds of the display. If so, it notifies the InputDispatcher about the touch event.

  6. If there are no touching tools but there is at least one hovering tool, the InputReader notifies the InputDispatcher about the hover event.

  7. If the touch device type is pointer, the InputReader performs pointer gesture detection, moves the pointer and spots accordingly and notifies the InputDispatcher about the pointer event.

  8. The InputDispatcher uses the WindowManagerPolicy to determine whether the events should be dispatched and whether they should wake the device. Then, theInputDispatcher delivers the events to the appropriate applications.

Touch Device Configuration

Touch 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:

Properties

The 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 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 Conventions

For documentation purposes, we will use the following conventions to describe the values used by the system during the calibration process.

Raw Axis Values

The following expressions denote the raw values reported by the touch device driver as EV_ABS events.

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 Ranges

The following expressions denote the bounds of raw values. They are obtained by calling EVIOCGABS ioctl for each axis.

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 Ranges

The 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 Configuration

The 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.

touch.deviceType

Definition: touch.deviceType = touchScreen | touchPad | pointer | default

Specifies the touch device type.

  • If the value is touchScreen, the touch device is a touch screen associated with a display.

  • If the value is touchPad, the touch device is a touch pad not associated with a display.

  • If the value is pointer, the touch device is a touch pad not associated with a display, and its motions are used for indirect multi-touch pointer gestures.

  • If the value is default, the system automatically detects the device type according to the classification algorithm.

Refer to the Classification section for more details about how the device type influences the behavior of the touch device.

Prior to Honeycomb, all touch devices were assumed to be touch screens.

touch.orientationAware

Definition: touch.orientationAware = 0 | 1

Specifies whether the touch device should react to display orientation changes.

  • If the value is 1, touch positions reported by the touch device are rotated whenever the display orientation changes.

  • If the value is 0, touch positions reported by the touch device are immune to display orientation changes.

The default value is 1 if the device is a touch screen, 0 otherwise.

The system distinguishes between internal and external touch screens and displays. An orientation aware internal touch screen is rotated based on the orientation of the internal display. An orientation aware external touch screen is rotated based on the orientation of the external display.

Orientation awareness is used to support rotation of touch screens on devices like the Nexus One. For example, when the device is rotated clockwise 90 degrees from its natural orientation, the absolute positions of touches are remapped such that a touch in the top-left corner of the touch screen's absolute coordinate system is reported as a touch in the top-left corner of the display's rotated coordinate system. This is done so that touches are reported with the same coordinate system that applications use to draw their visual elements.

Prior to Honeycomb, all touch devices were assumed to be orientation aware.

touch.gestureMode

Definition: touch.gestureMode = pointer | spots | default

Specifies the presentation mode for pointer gestures. This configuration property is only relevant when the touch device is of type pointer.

  • If the value is pointer, the touch pad gestures are presented by way of a cursor similar to a mouse pointer.

  • If the value is spots, the touch pad gestures are presented by an anchor that represents the centroid of the gesture and a set of circular spots that represent the position of individual fingers.

The default value is pointer when the INPUT_PROP_SEMI_MT input property is set, or spots otherwise.

X and Y Fields

The X and Y fields provide positional information for the center of the contact area.

Calculation

The calculation is straightforward: positional information from the touch driver is linearly interpolated to the output coordinate system.

xScale = output.width / raw.width
yScale = output.height / raw.height

If not orientation aware or screen rotation is 0 degrees:
output.x = (raw.x - raw.x.min) * xScale
output.y = (raw.y - raw.y.min) * yScale
Else If rotation is 90 degrees:
    output.x = (raw.y - raw.y.min) * yScale
    output.y = (raw.x.max - raw.x) * xScale
Else If rotation is 180 degrees:
    output.x = (raw.x.max - raw.x) * xScale
    output.y = (raw.y.max - raw.y) * yScale
Else If rotation is 270 degrees:
    output.x = (raw.y.max - raw.y) * yScale
    output.y = (raw.x - raw.x.min) * xScale
End If

TouchMajor, TouchMinor, ToolMajor, ToolMinor, Size Fields

The TouchMajor and TouchMinor fields describe the approximate dimensions of the contact area in output units (pixels).

The ToolMajor and ToolMinor fields describe the approximate dimensions of the tool itself in output units (pixels).

The Size field describes the normalized size of the touch relative to the largest possible touch that the touch device can sense. The smallest possible normalized size is 0.0 (no contact, or it is unmeasurable), and the largest possible normalized size is 1.0 (sensor area is saturated).

When both the approximate length and breadth can be measured, then the TouchMajor field specifies the longer dimension and the TouchMinor field specifies the shorter dimension of the contact area. When only the approximate diameter of the contact area can be measured, then the TouchMajor and TouchMinor fields will be equal.

Likewise, the ToolMajor field specifies the longer dimension and the ToolMinor field specifies the shorter dimension of the tool's cross-sectional area.

If the touch size is unavailable but the tool size is available, then the tool size will be set equal to the touch size. Conversely, if the tool size is unavailable but the touch size is available, then the touch size will be set equal to the tool size.

Touch devices measure or report the touch size and tool size in various ways. The current implementation supports three different kinds of measurements: diameter, area, and geometric bounding box in surface units.

touch.size.calibration

Definition: touch.size.calibration = none | geometric | diameter | area | default

Specifies the kind of measurement used by the touch driver to report the touch size and tool size.

  • If the value is none, the size is set to zero.

  • If the value is geometric, the size is assumed to be specified in the same surface units as the position, so it is scaled in the same manner.

  • If the value is diameter, the size is assumed to be proportional to the diameter (width) of the touch or tool.

  • If the value is area, the size is assumed to be proportional to the area of the touch or tool.

  • If the value is default, the system uses the geometric calibration if the raw.touchMajor or raw.toolMajor axis is available, otherwise it uses the none calibration.

touch.size.scale

Definition: touch.size.scale = <a non-negative floating point number>

Specifies a constant scale factor used in the calibration.

The default value is 1.0.

touch.size.bias

Definition: touch.size.bias = <a non-negative floating point number>

Specifies a constant bias value used in the calibration.

The default value is 0.0.

touch.size.isSummed

Definition: touch.size.isSummed = 0 | 1

Specifies whether the size is reported as the sum of the sizes of all active contacts, or is reported individually for each contact.

  • If the value is 1, the reported size will be divided by the number of contacts prior to use.

  • If the value is 0, the reported size will be used as is.

The default value is 0.

Some touch devices, particularly "Semi-MT" devices cannot distinguish the individual dimensions of multiple contacts so they report a size measurement that represents their total area or width. This property should only be set to 1 for such devices. If in doubt, set this value to 0.

Calculation

The calculation of the TouchMajor, TouchMinor, ToolMajor, ToolMinor and Size fields depends on the specified calibration parameters.

If raw.touchMajor and raw.toolMajor are available:
    touchMajor = raw.touchMajor
    touchMinor = raw.touchMinor
    toolMajor = raw.toolMajor
    toolMinor = raw.toolMinor
Else If raw.touchMajor is available:
    toolMajor = touchMajor = raw.touchMajor
    toolMinor = touchMinor = raw.touchMinor
Else If raw.toolMajor is available:
    touchMajor = toolMajor = raw.toolMajor
    touchMinor = toolMinor = raw.toolMinor
Else
    touchMajor = toolMajor = 0
    touchMinor = toolMinor = 0
    size = 0
End If

size = avg(touchMajor, touchMinor)

If touch.size.isSummed == 1:
    touchMajor = touchMajor / numberOfActiveContacts
    touchMinor = touchMinor / numberOfActiveContacts
    toolMajor = toolMajor / numberOfActiveContacts
    toolMinor = toolMinor / numberOfActiveContacts
    size = size / numberOfActiveContacts
End If

If touch.size.calibration == "none":
    touchMajor = toolMajor = 0
    touchMinor = toolMinor = 0
    size = 0
Else If touch.size.calibration == "geometric":
    outputScale = average(output.width / raw.width, output.height / raw.height)
    touchMajor = touchMajor * outputScale
    touchMinor = touchMinor * outputScale
    toolMajor = toolMajor * outputScale
    toolMinor = toolMinor * outputScale
Else If touch.size.calibration == "area":
    touchMajor = sqrt(touchMajor)
    touchMinor = touchMajor
    toolMajor = sqrt(toolMajor)
    toolMinor = toolMajor
Else If touch.size.calibration == "diameter":
    touchMinor = touchMajor
    toolMinor = toolMajor
End If

If touchMajor != 0:
    output.touchMajor = touchMajor * touch.size.scale + touch.size.bias
Else
    output.touchMajor = 0
End If

If touchMinor != 0:
    output.touchMinor = touchMinor * touch.size.scale + touch.size.bias
Else
    output.touchMinor = 0
End If

If toolMajor != 0:
    output.toolMajor = toolMajor * touch.size.scale + touch.size.bias
Else
    output.toolMajor = 0
End If

If toolMinor != 0:
    output.toolMinor = toolMinor * touch.size.scale + touch.size.bias
Else
    output.toolMinor = 0
End If

output.size = size

Pressure Field

The Pressure field describes the approximate physical pressure applied to the touch device as a normalized value between 0.0 (no touch) and 1.0 (full force).

A zero pressure indicates that the tool is hovering.

touch.pressure.calibration

Definition: touch.pressure.calibration = none | physical | amplitude | default

Specifies the kind of measurement used by the touch driver to report the pressure.

  • If the value is none, the pressure is unknown so it is set to 1.0 when touching and 0.0 when hovering.

  • If the value is physical, the pressure axis is assumed to measure the actual physical intensity of pressure applied to the touch pad.

  • If the value is amplitude, the pressure axis is assumed to measure the signal amplitude, which is related to the size of the contact and the pressure applied.

  • If the value is default, the system uses the physical calibration if the pressure axis available, otherwise uses none.

touch.pressure.scale

Definition: touch.pressure.scale = <a non-negative floating point number>

Specifies a constant scale factor used in the calibration.

The default value is 1.0 / raw.pressure.max.

Calculation

The calculation of the Pressure field depends on the specified calibration parameters.

If touch.pressure.calibration == "physical" or "amplitude":
    output.pressure = raw.pressure * touch.pressure.scale
Else
    If hovering:
        output.pressure = 0
    Else
        output.pressure = 1
    End If
End If

Orientation and Tilt Fields

The Orientation field describes the orientation of the touch and tool as an angular measurement. An orientation of 0 indicates that the major axis is oriented vertically, -PI/2indicates that the major axis is oriented to the left, PI/2 indicates that the major axis is oriented to the right. When a stylus tool is present, the orientation range may be described in a full circle range from -PI or PI.

The Tilt field describes the inclination of the tool as an angular measurement. A tilt of 0 indicates that the tool is perpendicular to the surface. A tilt of PI/2 indicates that the tool is flat on the surface.

touch.orientation.calibration

Definition: touch.orientation.calibration = none | interpolated | vector | default

Specifies the kind of measurement used by the touch driver to report the orientation.

  • If the value is none, the orientation is unknown so it is set to 0.

  • If the value is interpolated, the orientation is linearly interpolated such that a raw value of raw.orientation.min maps to -PI/2 and a raw value ofraw.orientation.max maps to PI/2. The center value of (raw.orientation.min + raw.orientation.max) / 2 maps to 0.

  • If the value is vector, the orientation is interpreted as a packed vector consisiting of two signed 4-bit fields. This representation is used on Atmel Object Based Protocol parts. When decoded, the vector yields an orientation angle and confidence magnitude. The confidence magnitude is used to scale the size information, unless it is geometric.

  • If the value is default, the system uses the interpolated calibration if the orientation axis available, otherwise uses none.

Calculation

The calculation of the Orientation and Tilt fields depends on the specified calibration parameters and available input.

If touch.tiltX and touch.tiltY are available:
    tiltXCenter = average(raw.tiltX.min, raw.tiltX.max)
    tiltYCenter = average(raw.tiltY.min, raw.tiltY.max)
    tiltXAngle = (raw.tiltX - tiltXCenter) * PI / 180
    tiltYAngle = (raw.tiltY - tiltYCenter) * PI / 180
    output.orientation = atan2(-sin(tiltXAngle), sinf(tiltYAngle))
    output.tilt = acos(cos(tiltXAngle) * cos(tiltYAngle))
Else If touch.orientation.calibration == "interpolated":
    center = average(raw.orientation.min, raw.orientation.max)
    output.orientation = PI / (raw.orientation.max - raw.orientation.min)
    output.tilt = 0
Else If touch.orientation.calibration == "vector":
    c1 = (raw.orientation & 0xF0) >> 4
    c2 = raw.orientation & 0x0F

    If c1 != 0 or c2 != 0:
        If c1 >= 8 Then c1 = c1 - 16
        If c2 >= 8 Then c2 = c2 - 16
        angle = atan2(c1, c2) / 2
        confidence = sqrt(c1*c1 + c2*c2)

        output.orientation = angle

        If touch.size.calibration == "diameter" or "area":
            scale = 1.0 + confidence / 16
            output.touchMajor *= scale
            output.touchMinor /= scale
            output.toolMajor *= scale
            output.toolMinor /= scale
        End If
    Else
        output.orientation = 0
    End If
    output.tilt = 0
Else
    output.orientation = 0
    output.tilt = 0
End If

If orientation aware:
    If screen rotation is 90 degrees:
        output.orientation = output.orientation - PI / 2
    Else If screen rotation is 270 degrees:
        output.orientation = output.orientation + PI / 2
    End If
End If

Distance Field

The Distance field describes the distance between the tool and the touch device surface. A value of 0.0 indicates direct contact and larger values indicate increasing distance from the surface.

touch.distance.calibration

Definition: touch.distance.calibration = none | scaled | default

Specifies the kind of measurement used by the touch driver to report the distance.

  • If the value is none, the distance is unknown so it is set to 0.

  • If the value is scaled, the reported distance is multiplied by a constant scale factor.

  • If the value is default, the system uses the scaled calibration if the distance axis available, otherwise uses none.

touch.distance.scale

Definition: touch.distance.scale = <a non-negative floating point number>

Specifies a constant scale factor used in the calibration.

The default value is 1.0.

Calculation

The calculation of the Distance field depends on the specified calibration parameters.

If touch.distance.calibration == "scaled":
    output.distance = raw.distance * touch.distance.scale
Else
    output.distance = 0
End If

Example

# Input device configuration file for a touch screen that supports pressure,
# size and orientation.  The pressure and size scale factors were obtained
# by measuring the characteristics of the device itself and deriving
# useful approximations based on the resolution of the touch sensor and the
# display.
#
# Note that these parameters are specific to a particular device model.
# Different parameters will need to be used for other devices.

# Basic Parameters
touch.deviceType = touchScreen
touch.orientationAware = 1

# Size
# Based on empirical measurements, we estimate the size of the contact
# using size = sqrt(area) * 28 + 0.
touch.size.calibration = area
touch.size.scale = 28
touch.size.bias = 0
touch.size.isSummed = 0

# Pressure
# Driver reports signal strength as pressure.
#
# A normal index finger touch typically registers about 80 signal strength
# units although we don't expect these values to be accurate.
touch.pressure.calibration = amplitude
touch.pressure.scale = 0.0125

# Orientation
touch.orientation.calibration = vector

Compatibility Notes

The configuration properties for touch devices changed significantly in Android Ice Cream Sandwich 4.0. All input device configuration files for touch devices must be updated to use the new configuration properties.

Older touch device drivers may also need to be updated.

Virtual Key Map Files

Touch devices are often used to implement virtual keys.

There are several ways of doing this, depending on the capabilities of the touch controller. Some touch controllers can be directly configured to implement soft keys by setting firmware registers. Other times it is desirable to perform the mapping from touch coordinates to key codes in software.

When virtual keys are implemented in software, the kernel must export a virtual key map file called virtualkeys.<devicename> as a board property. For example, if the touch screen device drivers reports its name as "touchyfeely" then the virtual key map file must have the path /sys/board_properties/virtualkeys.touchyfeely.

在文件:services/java/com/android/server/InputManager.java  line:425  的 InputManager函数中会通过驱动(基于input subsys的触摸屏驱动)中提供的deviceName来组合成“virtualkeys.touchyfeely”这样的文件名,并读取这个文件以解析出其中内容。所以,一定要保证你创建的这个sys文件的名字和驱动中的input设备名一致!("touchyfeely" should be replaced to your actual device name)

A virtual key map file describes the coordinates and Linux key codes of virtual keys on the touch screen.

In addition to the virtual key map file, there must be a corresponding key layout file and key character map file to map the Linux key codes to Android key codes and to specify the type of the keyboard device (usually SPECIAL_FUNCTION).

Syntax

A virtual key map file is a plain text file consisting of a sequence of virtual key layout descriptions either separated by newlines or by colons.

Comment lines begin with '#' and continue to the end of the line.

Each virtual key is described by 6 colon-delimited components:

  • 0x01: A version code. Must always be 0x01.
  • <Linux key code>: The Linux key code of the virtual key.
  • <centerX>: The X pixel coordinate of the center of the virtual key.
  • <centerY>: The Y pixel coordinate of the center of the virtual key.
  • <width>: The width of the virtual key in pixels.
  • <height>: The height of the virtual key in pixels.

All coordinates and sizes are specified in terms of the display coordinate system.

Here is a virtual key map file all written on one line.

# All on one line
0x01:158:55:835:90:55:0x01:139:172:835:125:55:0x01:102:298:835:115:55:0x01:217:412:835:95:55

NOTE:非常重要的,这里的中心坐标是相对LCD而言的,而不是TP的坐标,因此,如果你的TP的分辨率和LCD并非一一对应,你必须经过仔细计算,才能确定这里应该填入的值。

The same virtual key map file can also be written on multiple lines.

# One key per line
0x01:158:55:835:90:55
0x01:139:172:835:125:55
0x01:102:298:835:115:55
0x01:217:412:835:95:55

In the above example, the touch screen has a resolution of 480x800. Accordingly, all of the virtual keys have a <centerY> coordinate of 835, which is a little bit below the visible area of the touch screen.

The first key has a Linux scan code of 158 (KEY_BACK), centerX of 55, centerY of 835, width of 90 and height of 55.

Example

Virtual key map file: /sys/board_properties/virtualkeys.touchyfeely.

0x01:158:55:835:90:55
0x01:139:172:835:125:55
0x01:102:298:835:115:55
0x01:217:412:835:95:55

Key layout file: /system/usr/keylayout/touchyfeely.kl.

key 158 BACK
key 139 MENU
key 102 HOME
key 217 SEARCH

这个layout file一般存在于device/XXX仓库的某个产品目录下,如: xxx-dev/prebuilt/system/usr/keylayout/xxx-tp.kl  编译过程中xxx-dev目录中的AndroidBoard.mk会执行相关的copy动作以将该文件copy到相关位置。这个文件所涉及的对应关系,一般在默认文件:qwerty.kl 中可能已经有过正确的映射,所以可以不要自己的这个映射文件,除非你的映射和qwerty.kl中描述的不一样时才需要。

详情参考以下文档

http://source.android.com/tech/input/key-layout-files.html

下面这个kcm文件我没找到,不知道干啥用的。。。。


Key character map file: /system/usr/keychars/touchyfeely.kcm.

type SPECIAL_FUNCTION

Indirect Multi-touch Pointer Gestures

In pointer mode, the system interprets the following gestures:

  1. Single finger tap: click.

  2. Single finger motion: move the pointer.

  3. Single finger motion plus button presses: drag the pointer.

  4. Two finger motion both fingers moving in the same direction: drag the area under the pointer in that direction. The pointer itself does not move.

  5. Two finger motion both fingers moving towards each other or apart in different directions: pan/scale/rotate the area surrounding the pointer. The pointer itself does not move.

  6. Multiple finger motion: freeform gesture.

Further Reading

  1. Linux multi-touch protocol
  2. ENAC list of available multitouch devices on Linux

使用杰理 AC7925B 实现 Windows电脑 USB 副屏 本文记录使用杰理AC7925B开发板实现Windows USB副屏的全过程。通过复用乐鑫esp-iot-solution参考项目结构,基于开源驱动实现复合设备(扩展显示、触摸、音频),支持800×480 RGB565屏幕与GT911触控,实测帧率55–60fps,JPEG解码平均11ms/帧,CPU占用低,内存剩余约800KB,无需电脑端开发,即插即用。 阅读详情

相关推荐

input:ABS_DISTANCE上报空指针错误

在probe函数中设置事件类型EV_ABS和支持的事件码ABS_DISTANCE: input_set_capability(input_dev, EV_ABS, ABS_DISTANCE);然后在工作队列里上报传感器的数据: input_report_abs(dt->input, ABS_DISTANCE, 1); input_sync(dt->input); 运行程序,每次到

Eliot_shao的专栏 2724

手把手教你用yt-dlp批量下载YouTube视频数据集(附TikTok/Kaggle资源)

本文提供了一份构建视频数据集的实战指南,重点介绍了使用yt-dlp工具批量下载YouTube视频的高级技巧,包括环境配置、批量参数设置与自动化脚本。同时,文章还整合了TikTok、Kaggle及学术开源数据集等多源高质量视频资源,并分享了数据清洗、格式统一与管理的完整流程,帮助研究者和开发者高效获取与处理训练数据。

weixin_29057237的博客 294

linux之调试触摸屏驱动

设计了一块嵌入式电路板,运行linux系统,主控CPU为px30,需要适配一块触摸驱动IC为GT917S的5.0寸触摸屏。 SDK中原本适配的驱动IC为gsl680,.config配置如下: 取消gslX680 touchpad driver for 9tripod linux,选中Goodix gt9xx support for rockchip platform; 进入到px30_linux/kernel/arch/arm64/boot/dts/rockchip目录下,打...

professionalmcu的专栏 1万+

11.Labview实现用户界面切换的几种方式---通过VI间相互调用

本文介绍了界面切换的几种方式,分别是重入和引用①重入方式可以通过调用子VI的方式打开被调用的界面,往往应用于弹窗等的设置程序。②引用方式分两种,一种是打开引用,一种是静态引用。区别在于打开引用需要设置被打开VI的目标地址,静态引用仅需在引用时绑定VI的位置即可。③推荐使用静态引用的方式切换界面。④使用引用打开界面时,需通过属性节点和调用节点来设置程序的状态。更多内容欢迎大家补充和留言讨论~本文介绍了GUI界面设计相关的程序,更多相关文章后续持续更新,请关注作者不迷路~本期就到这里,再见~

关注我,更多技术问题欢迎私聊~ 9555

MATLAB基础应用精讲-【数模应用】信用评分模型(附R语言和python代码实现)

信用评分模型是近年来兴起的一种为了保障银行和其他金融部门的金融安全而设立的一种关于人身金融权限的划定模型。该模型指根据客户的信用历史资料,利用一定的信用评分模型,得到不同等级的信用分数,根据客户的信用分数,来决定客户所可以持有的金额权限,从而保证还款等业务的安全性。而随着在现代社会和公司中,贷款,信用卡的作用日渐突出,信用评分模型的发展前景不可估量。信贷风险是指借款人因偿还贷款或履行合同承诺而破产而产生损失的可能性。传统上,它与贷款人无法偿还所欠利息和本金、影响现金流和增加装配成本所产生的风险有关。

qq_36130719的博客 366

Adroid 触摸屏设备

1. 触摸屏设备分类 1.1 多点触摸 满足以下两个条件为多点触摸设备: 1)输入设备驱动报告了ABS_MT_POSITION_X 和ABS_MT_POSITION_Y存在 2)输入设备没有任何手柄按钮 1.2 单点触摸 满足以下两个条件为单点触摸设备: 1)输入设备不被归类为多点触摸设备 2)输入设备报告存在ABS_X和ABS_Y绝对轴,以及存在BTN_TOUCH按键码 1.3

MyArrow的专栏 1万+

深度解读 ABAP CDS View 中的 @Analytics.dataCategory: #FACT 注解

注解在 ABAP CDS View 中具有重要意义。它不仅定义了当前视图在数据模型中的角色,还为后续的分析和报告奠定了基础。在实际开发中,通过合理使用这一注解,可以显著提升数据模型的可用性和系统性能。无论是简单的 KPI 展示还是复杂的多维分析,这一注解都能发挥关键作用。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 791

Linux输入子系统:事件的编码 -- event-codes.txt

输入系统协议用类型types和编码codecs来表示输入设备的值并用此来通知用户空间的应用程序。这篇文档对这些类型和编码进行了说明并且指出什么时候和如何使用这些类型和编码。  一个单一的硬件事件可以产生多个输入事件,每个输入事件包含一个单一数据项的新的数据值。EV_SYN是一个特别的事件类型,它用来把同一时刻产生的多个输入数据分割为多个数据包。在下面的描述中,术语事件(event)是指一个涵盖类

DroidPhone的专栏 3万+

复现Fastjson反序列化漏洞(从dnslog回显到rce再到反弹shell)

Fastjson是阿里巴巴的开源JSON解析库,它可以解析 JSON 格式的字符串,支持将 Java Bean 序列化为 JSON 字符串,也可以从 JSON 字符串反序列化到 JavaBean。它还可以用于将JSON字符串转换为等效的Java对象,fastjson爆出多个反序列化远程命令执行漏洞,攻击者可以通过此漏洞远程执行恶意代码来入侵服务器。......

记录并分享学习安全的知识点.. 2702

5、模糊风险评估

本文介绍了基于模糊逻辑的风险评估方法,探讨了如何在不确定、不完整信息环境下进行高效的风险分析。文章涵盖了模糊集合与隶属度函数的基本概念、模糊推理系统的流程,并结合犯罪风险、金融风险和医疗诊断等实际案例,展示了模糊风险评估的应用价值和技术细节。此外,还介绍了模糊贝叶斯网络、模糊综合评价等进阶工具与方法,为多领域风险管理提供了理论支持和实践指导。

mango的博客 183

触摸设备

目录触摸设备分类按钮工具和工具类型悬停与触摸工具触摸设备驱动程序要求触摸设备操作触摸设备配置属性文档规范基础配置X 和 Y 字段TouchMajor、TouchMinor、ToolMajor、ToolMinor、Size 字段Pressure 字段Orientation 和 Tilt 字段Distance 字段示例兼容性说明虚拟按键映射文件语法示例间接多点触控指控手势延伸阅读 Android 支持各种触摸屏和触摸板,包括基于触控笔的数字化板。 触摸屏是与显示屏相关联的触摸设备,使用户能够在屏幕上

weixin_45331217的博客 2371

OBC_开环扫频波特图拟合操作流程(结合 Simulink)

摘要: 本文详细介绍了基于Simulink的开环扫频波特图测试与拟合流程,适用于电源/控制系统(如LLC/PFC)的小信号分析。主要内容包括:1)前期准备(测试点选择、信号范围设定);2)Simulink建模方法(信号注入、数据记录);3)两种扫频方式(逐频正弦/Chirp扫频)的实现;4)MATLAB数据处理(FFT分析、传递函数拟合);5)线性分析工具使用技巧。重点强调了激励信号幅值控制、稳态数据采集及模型验证方法,并提供完整MATLAB脚本示例。该流程可有效获取系统频域特性,为控制器设计提供可靠依据。

Sumerking的博客 234

android4 触摸屏驱动,android中如何设计触摸屏驱动touch screen driver

以下内容是来自android官方的文档,详细说明了android上层关心的event事件,如果要做一个好的TP驱动,这些信息是必须清楚的,另外现在的android2.3已经完全支持了virtualkey,如果要使用虚拟按键的话,这篇文章里面也详细作出了说明。总之,这是最有价值的文档!我先复制过来了,等我有空了翻译翻译。。。原文出自:Touch DevicesAndroid supports a v...

weixin_42451196的博客 1841

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

Linux/Android——usb触摸屏驱动 - usbtouchscreen (一)【转】

本文转载自:http://blog.youkuaiyun.com/jscese/article/details/41827495 最近需要往TV上装一个触摸屏设备,现在比较常见的就是使用usb接口的触摸框,适用于各种平台,这里大体记录一下在android上kernel中的usbtouchscreen驱动. ...

348

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

android 触摸屏驱动分析,rk3188--6.android 触摸屏驱动分析

在drivers/input/touchscreen/ft5302_tp/ft5302_ts.c中module_init(ft5x0x_ts_init);static int __init ft5x0x_ts_init(void){ret = i2c_add_driver(&ft5x0x_ts_driver);return ret;}其中ft5x0x_ts_driver结构如下:stati...

weixin_28783097的博客 558

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

linux usb touchscreen driver开发,Linux/Android——usb触摸屏驱动 - usbtouchscreen (一)【转】...

最近需要往TV上装一个触摸屏设备,现在比较常见的就是使用usb接口的触摸框,适用于各种平台,这里大体记录一下在android上kernel中的usbtouchscreen驱动.驱动编译:目前的kernel中都是自带了usbtouchscreen驱动的,我的版本3.1.10源码位于:/kernel/drivers/input/touchscreen/usbtouchscreen.c从这个路径可以看出...

weixin_29334463的博客 725

U2HTS触摸屏驱动开发与Linux内核逆向实践

触摸屏驱动是嵌入式系统人机交互的核心组件,通过I2C/SPI接口与控制器通信实现坐标采集。其技术原理涉及中断处理、HID协议转换和多点触控数据处理,可显著提升设备的交互体验。在工业控制、智能终端等领域,开源项目U2HTS提供了将专有触摸控制器转换为标准HID设备的解决方案。针对GT9XX等常见控制器,开发需重点处理寄存器访问、坐标校准和电源管理。当缺乏数据手册时,可通过逆向分析Linux内核驱动获取关键参数,配合逻辑分析仪验证通信协议。本文以GT9886为例,详解从驱动框架设计到性能优化的全流程实践。

weixin_34200628的博客 358

GD32H759+RT-Thread工控实战:SDRAM/SDIO/触摸屏三重协同设计

在嵌入式工控系统中,实时性、确定性与多外设协同是核心挑战。基于Cortex-M7架构的高性能MCU(如GD32H759)需配合成熟RTOS(如RT-Thread)构建稳定数据通路,其技术价值不仅在于算力提升,更在于通过AXI总线、内存管理器(MM)与外设驱动深度协同,解决高精度采样、实时控制与人机交互并行运行的资源争抢问题。典型应用场景包括空压机控制器、PLC边缘节点等对可靠性要求严苛的工业设备。本文聚焦GD32H759平台下SDRAM大容量缓存调度、SDIO Wi-Fi非阻塞通信及电阻式触摸屏工业级校准三

weixin_34175509的博客 560

嵌入式Linux驱动开发实战:从设备树到安卓HAL的全栈能力构建

Linux设备驱动是操作系统与硬件交互的核心枢纽,其本质是通过内核子系统(如input、pwm、regulator)对物理资源进行抽象与调度。理解驱动模型需掌握三大原理:设备与驱动的动态匹配机制(OF+platform总线)、资源生命周期管理(devm_系列API与runtime_pm)、用户空间接口标准化(sysfs/ioctl/input_event)。这类能力直接支撑智能终端底层开发,在车载中控、工业HMI、AIoT边缘设备等场景中不可替代。本文聚焦嵌入式Linux安卓驱动开发实战,深入解析设备树绑定

weixin_34416649的博客 387

台电X98 Plus双系统平板升级Win10/Win11实战:驱动破解与性能优化全攻略

系统重装与驱动适配是老旧设备焕发新生的核心技术环节。其原理在于通过手动替换或修改系统核心文件与驱动程序,绕过硬件限制,使本已停止官方支持的老旧硬件能够运行新版操作系统。这一过程的技术价值在于最大化硬件生命周期,降低电子废弃物,并为预算有限的用户提供可行的生产力解决方案。应用场景广泛覆盖了个人老旧电脑升级、特定行业工控设备维护以及嵌入式开发环境搭建等。本文以搭载英特尔Atom Z3735F处理器的台电X98 Plus双系统平板为例,深入解析如何通过获取特定版本的Win10 LTSC或修改Win11镜像完成系统

weixin_30896511的博客 329

大麦自动抢票完整指南:3 个脚本跑通手机 App 与网页双端购票流程

大麦自动抢票(ticket-purchase)是一个 Python 写的开源购票自动化工具,把"选城市—选票档—勾观演人—提交订单"这套固定点击交给脚本,同时给出网页端(Selenium 驱动 Chrome 浏览器)和手机 App 端(Appium 驱动安卓客户端)两条可独立运行的路线。适合手头有 Android 模拟器或真机、要赶热门演出开售、愿意提前配好环境做演练的人。 ## 🎯 谁该用自

gitblog_01008的博客 459

Appium API 核心功能与实战技巧:从元素定位到混合应用测试

移动端自动化测试是保障应用质量的关键环节,其核心在于通过脚本模拟用户操作,实现功能验证与回归测试。其原理基于客户端-服务器架构,测试脚本通过标准协议(如W3C WebDriver)向自动化服务器发送指令,驱动真实设备或模拟器执行操作。这项技术的价值在于提升测试效率、覆盖复杂场景并确保跨平台一致性,广泛应用于金融、电商、社交等各类移动应用的UI测试、兼容性测试与性能监控。在实际工程中,**元素定位**与**会话管理**是构建稳定自动化脚本的基石,开发者需要掌握多种定位策略(如ID、XPath、平台专属定位器)

weixin_30740295的博客 376

ESP32-P4高性能MCU实战:从环境搭建到ROS2小车开发

ESP32-P4是乐鑫首款面向高性能应用的双核RISC-V处理器,主频达400MHz,并集成H.264编码器与AI指令扩展,在内存带宽和PSRAM支持上远超S3/C3系列。凭借更强的外设能力和多任务并行表现,它正逐渐成为移动机器人主控、HMI屏幕和嵌入式视觉原型设计的理想选择。开发者可基于Arduino、ESP-IDF或PlatformIO快速搭建开发环境,但国内网络环境下常需要借助esp32国内源或esp32离线安装包加速工具链部署;烧录环节则可通过官方Flash Download Tools完成,避免因

weixin_33968104的博客 402

note

CPU,此处CPU与BL芯片断开,没有连背光芯片。屏,此处屏与BL芯片断开,没有连背光芯片。虽然signal函数更简单些。行 3744: 07-22 23:56:01.139 <6>[ 5.577037][ T919] [2024:07:22 15:55:51](7)[919:modprobe][drm] [lcdkit /I]: type:66, name:[qcom,mdss-dsi-apl-bl-mode-off-command], length:16, pkt-count=1。

m0_73462935的博客 10万+
上一篇: ATMEL mXT224电容触摸屏调试笔记
下一篇: Virtual Keyboards on iPhone and Android
YasinLeeX
博客等级 码龄19年 380粉丝 310原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

YasinLeeX

再来一杯西湖龙井。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值