Exemplo n.º 1
0
            m.press()

        val = int(line.split()[3], 16)
        if (pre_x != None):
            d_x = val - pre_x
            pre_x = val
        else:
            pre_x = val
            if not is_scrolled:
                continue

        if not cur_anchor_x:
            cur_anchor_x = val
        elif not is_scrolled:
            d_x = pow(abs(d_x) * MOVE_SENSITIVITY, MOVE_SCALING) * sing(d_x)
            m.move_dx(round(d_x))

    elif not is_stop and ('ABS_MT_POSITION_Y' in line and horizontal
                          or 'ABS_MT_POSITION_X' in line and not horizontal):

        unpress_time = get_time_delta_in_microseconds(press_down_time,
                                                      datetime.now())
        if unpress_time > SHORT_PRESS:
            count_click = 0

        if (count_click == 0 and wasnt_moved() and not is_holded
                and press_down_time != None):
            press_time = get_time_delta_in_microseconds(
                press_down_time, datetime.now())
            if press_time > LONG_PRESS:
                is_holded = True