|
5 | 5 | from functools import partial |
6 | 6 |
|
7 | 7 | from kitty.fast_data_types import ( |
8 | | - GLFW_MOD_ALT, GLFW_MOD_CONTROL, GLFW_MOUSE_BUTTON_LEFT, create_mock_window, |
| 8 | + GLFW_MOD_ALT, GLFW_MOD_CONTROL, GLFW_MOUSE_BUTTON_LEFT, |
| 9 | + GLFW_MOUSE_BUTTON_RIGHT, create_mock_window, |
9 | 10 | send_mock_mouse_event_to_window |
10 | 11 | ) |
11 | 12 |
|
@@ -55,12 +56,12 @@ def init(): |
55 | 56 | s.draw('fghij') |
56 | 57 | s.draw('klmno') |
57 | 58 |
|
58 | | - def press(x=0, y=0, modifiers=0): |
59 | | - ev(GLFW_MOUSE_BUTTON_LEFT, x=x, y=y, modifiers=modifiers) |
| 59 | + def press(x=0, y=0, modifiers=0, button=GLFW_MOUSE_BUTTON_LEFT): |
| 60 | + ev(button, x=x, y=y, modifiers=modifiers) |
60 | 61 |
|
61 | | - def release(x=0, y=0): |
| 62 | + def release(x=0, y=0, button=GLFW_MOUSE_BUTTON_LEFT): |
62 | 63 | ev( |
63 | | - GLFW_MOUSE_BUTTON_LEFT, |
| 64 | + button, |
64 | 65 | x=x, |
65 | 66 | y=y, |
66 | 67 | is_release=True, |
@@ -200,3 +201,16 @@ def scroll(x=0, y=0, up=True): |
200 | 201 | scroll(x=2.6, up=False) |
201 | 202 | self.ae(sel(), '3') |
202 | 203 | release() |
| 204 | + |
| 205 | + # extending selections |
| 206 | + init() |
| 207 | + press() |
| 208 | + move(x=3.6, q='1234') |
| 209 | + release(x=3.6) |
| 210 | + self.ae(sel(), '1234') |
| 211 | + press(x=1, y=1, button=GLFW_MOUSE_BUTTON_RIGHT) |
| 212 | + self.ae(sel(), '123456') |
| 213 | + move(x=2, y=1) |
| 214 | + self.ae(sel(), '1234567') |
| 215 | + release(x=3, y=1, button=GLFW_MOUSE_BUTTON_RIGHT) |
| 216 | + self.ae(sel(), '12345678') |
0 commit comments