tests_kernel.test_multitouch module

BIT(x)
class BaseTest

Bases: object

class TestMultitouch

Bases: TestUhid

create_device()
get_slot(uhdev, t, default)
kernel_modules: list[KernelModule] = [KernelModule(driver_name='hid-multitouch', module_name='hid_multitouch')]
test_creation()

Make sure the device gets processed by the kernel and creates the expected application input node.

If this fail, there is something wrong in the device report descriptors.

test_mt_contact_count_accurate()

Test the MT_QUIRK_CONTACT_CNT_ACCURATE from the kernel. A report should forward an accurate contact count and the kernel should ignore any data provided after we have reached this contact count.

test_mt_dual_touch()

Send 2 touches in the first 2 slots. Make sure the kernel sees this as a dual touch. Release and check

Note: PTP will send here BTN_DOUBLETAP emulation

test_mt_max_contact()

send the maximum number of contact as reported by the device. Make sure all contacts are forwarded and that there is no miss. Release and check.

test_mt_single_touch()

send a single touch in the first slot of the device, and release it.

test_mt_triple_tap()

Send 3 touches in the first 3 slots. Make sure the kernel sees this as a triple touch. Release and check

Note: PTP will send here BTN_TRIPLETAP emulation

test_required_usages()

Make sure the device exports the correct required features and inputs.

class TestPTP

Bases: TestWin8Multitouch

test_ptp_buttons()

check for button reliability. There are 2 types of touchpads: the click pads and the pressure pads. Each should reliably report the BTN_LEFT events.

test_ptp_confidence()

Check for the validity of the confidence bit. When a contact is marked as not confident, it should be detected as a palm from the kernel POV and released.

Note: if the kernel exports ABS_MT_TOOL_TYPE, it shouldn’t release the touch but instead convert it to ABS_MT_TOOL_PALM.

test_ptp_non_touch_data()

Some single finger hybrid touchpads might not provide the button information in subsequent reports (only in the first report).

Emulate this and make sure we do not release the buttons in the middle of the event.

class TestWin8Multitouch

Bases: TestMultitouch

test_mt_azimuth()

Check for the azimtuh information bit. When azimuth is presented by the device, it should be exported as ABS_MT_ORIENTATION and the exported value should report a quarter of circle.

test_mt_duplicates()

Test the MT_QUIRK_IGNORE_DUPLICATES from the kernel. If a touch is reported more than once with the same Contact ID, we should only handle the first touch.

Note: this is not in MS spec, but the current kernel behaves like that

test_mt_inrange()

Send one contact that has the InRange bit set before/after tipswitch. Kernel is supposed to mark the contact with a distance > 0 when inrange is set but not tipswitch.

This tests the hovering capability of devices (MT_QUIRK_HOVERING).

Make sure the contact is only released from the kernel POV when the inrange bit is set to 0.

test_mt_release_miss()

send a single touch in the first slot of the device, and forget to release it. The kernel is supposed to release by itself the touch in 100ms. Make sure that we are dealing with a new touch by resending the same touch after the timeout expired, and check that the kernel considers it as a separate touch (different tracking ID)

test_mt_tx_cx()

send a single touch in the first slot of the device, with different values of Tx and Cx. Make sure the kernel reports Tx.

test_required_usages8()

Make sure the device exports the correct required features and inputs.

class Data

Bases: object

class Digitizer(name, rdesc_str=None, rdesc=None, application='Touch Screen', physical='Finger', max_contacts=None, input_info=(BusType.USB, 1, 2), quirks=None)

Bases: UHIDTestDevice

event(slots, global_data=None, contact_count=None, incr_scantime=True)
get_report(req, rnum, rtype)

Callback invoked when a process calls SetReport on this UHID device.

Return (0, [data bytes]) on success or (errno, []) on failure.

The default method always returns (EIO, []) for a failure. Override this in your device if you want GetReport to succeed.

Parameters:
  • req – the request identifier

  • rnum

    ???

  • rtype – one of UHID_FEATURE_REPORT, UHID_INPUT_REPORT, or UHID_OUTPUT_REPORT

classmethod msCertificationBlob(reportID)
set_report(req, rnum, rtype, data)

Callback invoked when a process calls SetReport on this UHID device.

Return 0 on success or an errno on failure.

The default method always returns EIO for a failure. Override this in your device if you want SetReport to succeed.

Parameters:
  • req – the request identifier

  • rnum

    ???

  • rtype – one of UHID_FEATURE_REPORT, UHID_INPUT_REPORT, or UHID_OUTPUT_REPORT

  • data (list) – a byte string with the data

property touches_in_a_report
class HIDButtonType(*values)

Bases: IntEnum

CLICKPAD = 0
DISCRETE_BUTTONS = 2
PRESSUREPAD = 1
class MinWin8TSHybrid

Bases: Digitizer

class MinWin8TSParallel(max_slots)

Bases: Digitizer

class PTP(name, buttontype=HIDButtonType.CLICKPAD, rdesc_str=None, rdesc=None, application='Touch Pad', physical='Pointer', max_contacts=None, input_info=None)

Bases: Digitizer

event(slots=None, click=None, left=None, right=None, contact_count=None, incr_scantime=True)
class Pen(x, y)

Bases: Touch

class SmartTechDigitizer(name, input_info)

Bases: Digitizer

create_report(data, global_data=None, reportID=None, application=None)

Convert the data object to an array of ints representing the report. Each property of the given data object is matched against the field usage name (think hasattr) and filled in accordingly.:

mouse = MouseData()
mouse.b1 = int(l)
mouse.b2 = int(r)
mouse.b3 = int(m)
mouse.x = x
mouse.y = y

data_bytes = uhid_device.create_report(mouse)

The UHIDDevice will create the report according to the device’s report descriptor.

match_evdev_rule(application, evdev)

Replace this in subclasses if the device has multiple reports of the same type and we need to filter based on the actual evdev node.

returning True will append the corresponding report to self.input_nodes[type] returning False will ignore this report / type combination for the device.

class Test3m_0596_0500

Bases: TestMultitouch

create_device()
class Test3m_0596_0506

Bases: TestMultitouch

create_device()
class Test3m_0596_051c

Bases: TestWin8Multitouch

create_device()
class TestActionStar_2101_1011

Bases: TestMultitouch

create_device()
test_mt_actionstar_inrange()

Special sequence that might not be handled properly

class TestAsus_computers_0486_0185

Bases: TestMultitouch

create_device()
class TestAtmel_03eb_201c

Bases: TestMultitouch

create_device()
class TestAtmel_03eb_211c

Bases: TestMultitouch

create_device()
class TestCVTouch_1ff7_0013

Bases: TestMultitouch

create_device()
class TestCando_2087_0a02

Bases: TestMultitouch

create_device()
class TestCando_2087_0b03

Bases: TestMultitouch

create_device()
class TestCvtouch_1ff7_0017

Bases: TestMultitouch

create_device()
class TestCypress_04b4_c001

Bases: TestMultitouch

create_device()
class TestData_modul_7374_1232

Bases: TestMultitouch

create_device()
class TestData_modul_7374_1252

Bases: TestMultitouch

create_device()
class TestE4_2219_044c

Bases: TestMultitouch

create_device()
class TestEgalax_capacitive_0eef_7224

Bases: TestMultitouch

create_device()
class TestEgalax_capacitive_0eef_72fa

Bases: TestMultitouch

create_device()
class TestEgalax_capacitive_0eef_7336

Bases: TestMultitouch

create_device()
class TestEgalax_capacitive_0eef_7337

Bases: TestMultitouch

create_device()
class TestEgalax_capacitive_0eef_7349

Bases: TestMultitouch

create_device()
class TestEgalax_capacitive_0eef_73f4

Bases: TestMultitouch

create_device()
class TestEgalax_capacitive_0eef_a001

Bases: TestMultitouch

create_device()
class TestElanXPS9360

Bases: TestWin8Multitouch

create_device()
class TestElo_touchsystems_04e7_0022

Bases: TestMultitouch

create_device()
class TestElo_touchsystems_04e7_0080

Bases: TestMultitouch

create_device()
class TestFlatfrog_25b5_0002

Bases: TestMultitouch

create_device()
class TestFocaltech_10c4_81b9

Bases: TestMultitouch

create_device()
class TestHanvon_20b3_0a18

Bases: TestMultitouch

create_device()
class TestHuitoo_03f7_0003

Bases: TestMultitouch

create_device()
class TestIdeacom_1cb6_6650

Bases: TestMultitouch

create_device()
class TestIdeacom_1cb6_6651

Bases: TestMultitouch

create_device()
class TestIkaist_2793_0001

Bases: TestMultitouch

create_device()
class TestIrmtouch_23c9_5666

Bases: TestMultitouch

create_device()
class TestIrtouch_6615_0070

Bases: TestMultitouch

create_device()
class TestIrtouch_6615_0081

Bases: TestMultitouch

create_device()
class TestLG_043e_9aa1

Bases: TestMultitouch

create_device()
class TestLG_043e_9aa3

Bases: TestMultitouch

create_device()
class TestLG_1fd2_0064

Bases: TestMultitouch

create_device()
class TestLumio_202e_0006

Bases: TestMultitouch

create_device()
class TestLumio_202e_0007

Bases: TestMultitouch

create_device()
class TestMinWin8TSHybrid

Bases: TestWin8Multitouch

create_device()
class TestMinWin8TSParallel

Bases: TestWin8Multitouch

create_device()
class TestMinWin8TSParallelTriple

Bases: TestWin8Multitouch

create_device()
class TestNexio_1870_0100

Bases: TestMultitouch

create_device()
class TestNexio_1870_010d

Bases: TestMultitouch

create_device()
class TestNexio_1870_0119

Bases: TestMultitouch

create_device()
class TestPenmount_14e1_3500

Bases: TestMultitouch

create_device()
class TestPixart_093a_8002

Bases: TestMultitouch

create_device()
class TestPqlabs_1ef1_0001

Bases: TestMultitouch

create_device()
class TestQuanta_0408_3000

Bases: TestMultitouch

create_device()
class TestQuanta_0408_3001

Bases: TestMultitouch

create_device()
class TestQuanta_0408_3008

Bases: TestMultitouch

create_device()
class TestQuanta_0408_3008_1

Bases: TestMultitouch

create_device()
class TestRafi_05bd_0107

Bases: TestMultitouch

create_device()
class TestRndplus_2512_5003

Bases: TestMultitouch

create_device()
class TestRndplus_2512_5004

Bases: TestMultitouch

create_device()
class TestSitronix_1403_5001

Bases: TestMultitouch

create_device()
class TestSmart_0b8c_0092

Bases: TestMultitouch

create_device()
class TestStantum_1f87_0002

Bases: TestMultitouch

create_device()
class TestSurfaceBook2

Bases: TestPTP

create_device()
class TestTopseed_1784_0016

Bases: TestMultitouch

create_device()
class TestTouchpadXPS9360

Bases: TestPTP

create_device()
class TestTpv_25aa_8883

Bases: TestMultitouch

create_device()
class TestTrs_star_238f_0001

Bases: TestMultitouch

create_device()
class TestUnitec_227d_0103

Bases: TestMultitouch

create_device()
class TestWin8TSConfidence

Bases: TestWin8Multitouch

create_device()
test_mt_confidence_bad_release()

Check for the validity of the confidence bit. When a contact is marked as not confident, it should be detected as a palm from the kernel POV and released.

Note: if the kernel exports ABS_MT_TOOL_TYPE, it shouldn’t release the touch but instead convert it to ABS_MT_TOOL_PALM.

class TestZytronic_14c8_0005

Bases: TestMultitouch

create_device()
class TestZytronic_14c8_0006

Bases: TestMultitouch

create_device()
class Testadvanced_silicon_04e8_2084

Bases: TestWin8Multitouch

create_device()
class Testadvanced_silicon_2149_2306

Bases: TestWin8Multitouch

create_device()
class Testadvanced_silicon_2149_230a

Bases: TestWin8Multitouch

create_device()
class Testadvanced_silicon_2149_231c

Bases: TestWin8Multitouch

create_device()
class Testadvanced_silicon_2149_2703

Bases: TestWin8Multitouch

create_device()
class Testadvanced_silicon_2149_270b

Bases: TestWin8Multitouch

create_device()
class Testadvanced_silicon_2575_0204

Bases: TestWin8Multitouch

found on the Dell Canvas 27

create_device()
class Testadvanced_silicon_2619_5610

Bases: TestWin8Multitouch

create_device()
class Testatmel_03eb_8409

Bases: TestWin8Multitouch

create_device()
class Testatmel_03eb_840b

Bases: TestWin8Multitouch

create_device()
class Testdell_044e_1220

Bases: TestPTP

create_device()
class Testdell_06cb_75db

Bases: TestPTP

create_device()
class Testegalax_capacitive_0eef_790a

Bases: TestWin8Multitouch

create_device()
class Testelan_04f3_000a

Bases: TestWin8Multitouch

create_device()
class Testelan_04f3_000c

Bases: TestWin8Multitouch

create_device()
class Testelan_04f3_010c

Bases: TestWin8Multitouch

create_device()
class Testelan_04f3_0125

Bases: TestWin8Multitouch

create_device()
class Testelan_04f3_016f

Bases: TestWin8Multitouch

create_device()
class Testelan_04f3_0732

Bases: TestWin8Multitouch

create_device()
class Testelan_04f3_200a

Bases: TestWin8Multitouch

create_device()
class Testelan_04f3_300b

Bases: TestPTP

create_device()
class Testelan_04f3_3045

Bases: TestPTP

create_device()
class Testelan_04f3_313a

Bases: TestPTP

create_device()
class Testelo_04e7_0080

Bases: TestWin8Multitouch

create_device()
class Testilitek_222a_0015

Bases: TestWin8Multitouch

create_device()
class Testilitek_222a_001c

Bases: TestWin8Multitouch

create_device()
class Testite_06cb_2968

Bases: TestPTP

create_device()
class Testn_trig_1b96_0c01

Bases: TestWin8Multitouch

create_device()
class Testn_trig_1b96_0c03

Bases: TestWin8Multitouch

create_device()
class Testn_trig_1b96_0f00

Bases: TestWin8Multitouch

create_device()
class Testn_trig_1b96_0f04

Bases: TestWin8Multitouch

create_device()
class Testn_trig_1b96_1000

Bases: TestWin8Multitouch

create_device()
class Testsharp_04dd_9681

Bases: TestWin8Multitouch

create_device()
class Testsipodev_0603_0002

Bases: TestPTP

create_device()
class Testsynaptics_06cb_1d10

Bases: TestWin8Multitouch

create_device()
class Testsynaptics_06cb_ce08

Bases: TestPTP

create_device()
class Touch(id, x, y)

Bases: object

class Win8TSConfidence(max_slots)

Bases: Digitizer