Esempio n. 1
0
def send_input(n, action):
    s = control.nexus().comm.get_com("grids")

    int_a = int(action)
    response = None

    if int_a != 2:
        s.go(str(n))
    elif int_a == 2:
        response = s.retrieve_data_for_highlight(str(int(n)))

    s.kill()
    navigation.wait_for_grid_exit()

    if int_a == 0:
        Playback([(["mouse", "left", "click"], 0.0)]).execute()
    elif int_a == 1:
        Playback([(["mouse", "right", "click"], 0.0)]).execute()
    elif int_a == 2:
        x1 = response["l"] + 2
        x2 = response["r"]
        y = response["y"]
        Mouse("[{}, {}]".format(x1, y)).execute()
        time.sleep(0.1)
        Mouse("left:down").execute()
        Mouse("[{}, {}]".format(x2, y)).execute()
        time.sleep(0.1)
        Mouse("left:up").execute()
Esempio n. 2
0
def move_mouse(n, s, action):
    sudoku = control.nexus().comm.get_com("grids")
    sudoku.move_mouse(int(n), int(s))
    sudoku.kill()
    navigation.wait_for_grid_exit()
    time.sleep(0.1)
    perform_mouse_action(int(action))
Esempio n. 3
0
def select_text():
    global x1, y1, x2, y2
    x2, y2 = get_cursor_position()
    s = control.nexus().comm.get_com("grids")
    s.kill()
    navigation.wait_for_grid_exit()
    drag_from_to(x1, y1, x2, y2)
Esempio n. 4
0
def send_input_select(x1, y1, x2, y2):
    s = control.nexus().comm.get_com("grids")
    s.move_mouse(int(x1), int(y1))
    _x1, _y1 = get_cursor_position()
    s.move_mouse(int(x2), int(y2))
    _x2, _y2 = get_cursor_position()
    s.kill()
    navigation.wait_for_grid_exit()
    drag_from_to(_x1, _y1, _x2, _y2)
Esempio n. 5
0
def send_input_select(pre1, color1, n1, pre2, color2, n2):
    s = control.nexus().comm.get_com("grids")
    s.move_mouse(int(pre1), int(color1), int(n1))
    _x1, _y1 = get_cursor_position()
    s.move_mouse(int(pre2), int(color2), int(n2))
    _x2, _y2 = get_cursor_position()
    s.kill()
    navigation.wait_for_grid_exit()
    drag_from_to(_x1, _y1, _x2, _y2)
Esempio n. 6
0
def send_input(x, y, action):
    s = control.nexus().comm.get_com("grids")
    s.move_mouse(int(x), int(y))
    int_a = int(action)
    if (int_a == 0) | (int_a == 1) | (int_a == -1):
        s.kill()
        navigation.wait_for_grid_exit()
    if int_a == 0:
        Mouse("left").execute()
    elif int_a == 1:
        Mouse("right").execute()
Esempio n. 7
0
def send_input(pre, color, n, action):
    s = control.nexus().comm.get_com("grids")
    s.move_mouse(int(pre), int(color), int(n))
    int_a = int(action)
    if (int_a == 0) | (int_a == 1) | (int_a == -1):
        s.kill()
        navigation.wait_for_grid_exit()
        time.sleep(0.1)
    if int_a == 0:
        Mouse("left").execute()
    elif int_a == 1:
        Mouse("right").execute()
Esempio n. 8
0
def drag_mouse(n0, s0, n, s, action):
    sudoku = control.nexus().comm.get_com("grids")
    x, y = sudoku.get_mouse_pos(int(n), int(s))
    # If dragging from a different location, move there first
    if int(n0) > 0:
        sudoku.move_mouse(int(n0), int(s0))
    sudoku.kill()
    navigation.wait_for_grid_exit()
    time.sleep(0.1)
    # Hold down click, move to drag destination, and release click
    Mouse("left:down/10").execute()
    Mouse("[{}, {}]".format(x, y)).execute()
    time.sleep(0.1)
    Mouse("left:up/30").execute()
    perform_mouse_action(int(action))
Esempio n. 9
0
def drag_highlight(n1, n2):
    s = control.nexus().comm.get_com("grids")
    response1 = s.retrieve_data_for_highlight(str(int(n1)))
    response2 = s.retrieve_data_for_highlight(str(int(n2)))
    s.kill()
    navigation.wait_for_grid_exit()
    x11 = response1["l"] + 2
    y1 = response1["y"]
    x22 = response2["r"]
    y2 = response2["y"]
    Mouse("[{}, {}]".format(x11, y1)).execute()
    time.sleep(0.1)
    Mouse("left:down").execute()
    Mouse("[{}, {}]".format(x22, y2)).execute()
    time.sleep(0.1)
    Mouse("left:up").execute()