tools/testing/selftests/hid/tests/test_multitouch.py

Source file repositories/reference/linux-study-clean/tools/testing/selftests/hid/tests/test_multitouch.py

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/hid/tests/test_multitouch.py
Extension
.py
Size
235079 bytes
Lines
2179
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: tools
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

#!/bin/env python3
# SPDX-License-Identifier: GPL-2.0
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Benjamin Tissoires <benjamin.tissoires@gmail.com>
# Copyright (c) 2017 Red Hat, Inc.
#

from . import base
from hidtools.hut import HUT
from hidtools.util import BusType
import enum
import libevdev
import logging
import pytest
import sys
import time

logger = logging.getLogger("hidtools.test.multitouch")

KERNEL_MODULE = base.KernelModule("hid-multitouch", "hid_multitouch")


def BIT(x):
    return 1 << x


mt_quirks = {
    "NOT_SEEN_MEANS_UP": BIT(0),
    "SLOT_IS_CONTACTID": BIT(1),
    "CYPRESS": BIT(2),
    "SLOT_IS_CONTACTNUMBER": BIT(3),
    "ALWAYS_VALID": BIT(4),
    "VALID_IS_INRANGE": BIT(5),
    "VALID_IS_CONFIDENCE": BIT(6),
    "CONFIDENCE": BIT(7),
    "SLOT_IS_CONTACTID_MINUS_ONE": BIT(8),
    "NO_AREA": BIT(9),
    "IGNORE_DUPLICATES": BIT(10),
    "HOVERING": BIT(11),
    "CONTACT_CNT_ACCURATE": BIT(12),
    "FORCE_GET_FEATURE": BIT(13),
    "FIX_CONST_CONTACT_ID": BIT(14),
    "TOUCH_SIZE_SCALING": BIT(15),
    "STICKY_FINGERS": BIT(16),
    "ASUS_CUSTOM_UP": BIT(17),
    "WIN8_PTP_BUTTONS": BIT(18),
    "SEPARATE_APP_REPORT": BIT(19),
    "MT_QUIRK_FORCE_MULTI_INPUT": BIT(20),
}


class Data(object):
    pass


class Touch(object):
    def __init__(self, id, x, y):
        self.contactid = id
        self.x = x
        self.y = y
        self.cx = x
        self.cy = y
        self.tipswitch = True
        self.confidence = True
        self.tippressure = 15
        self.azimuth = 0
        self.inrange = True
        self.width = 10
        self.height = 10

Annotation

Implementation Notes