Skip to content

Touch Screen Calibration is a Touch Tricky on Round Displays! #528

@StephenDone

Description

@StephenDone

Describe the bug
The corners of the round screen are hard to press :-)

Expected behavior
Red squares within the screen extents when the display is round.

Images

Image

Thoughts
You could perhaps have an optional parameter to the calibrate() method 'round=False'

Here's some code I wrote to place 3 squares around the radius of a round display in touch_calibrate.py...

def calibrate(indev, cal_data):

    if not task_handler.TaskHandler.is_running():
        th_running = False
        task_handler.TaskHandler()
    else:
        th_running = True

    width = indev._orig_width  # NOQA
    height = indev._orig_height  # NOQA

    # coords = [
    #     [20, 20],  # upper left
    #     [width - 40, 20],  # upper right
    #     [20, height - 40]  # lower left
    # ]
    # target_points = [
    #     dict(x=30, y=30),  # upper left
    #     dict(x=width - 30, y=30),  # upper right
    #     dict(x=30, y=height - 30),  # lower left
    # ]

    from math import sin, cos, radians, floor

    radius = width // 2
    opposite = floor( sin(radians(30)) * (radius-30) )
    adjacent = floor( cos(radians(30)) * (radius-30) )

    coords = [
        [radius            -10,                     20],  # upper left
        [radius - adjacent -10, radius + opposite - 10],  # upper right
        [radius + adjacent -10, radius + opposite - 10]  # lower left
    ]

    target_points = [
        dict(x=radius,          y=30),  # upper middle
        dict(x=radius-adjacent, y=radius+opposite),  # upper right
        dict(x=radius+adjacent, y=radius+opposite),  # lower left
    ]

    captured_points = [
        dict(x=[], y=[]),
        dict(x=[], y=[]),
        dict(x=[], y=[])
    ]

    old_scrn = lv.screen_active()  # NOQA
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions