aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'input.c')
-rw-r--r--input.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/input.c b/input.c
index 9e260e69..518a690b 100644
--- a/input.c
+++ b/input.c
@@ -255,11 +255,22 @@ execute_binding(struct seat *seat, struct terminal *term,
}
case BIND_ACTION_SELECT_BEGIN:
- selection_start(
- term, seat->mouse.col, seat->mouse.row,
- seat->kbd.ctrl ? SELECTION_BLOCK : SELECTION_NORMAL);
+ selection_start(term, seat->mouse.col, seat->mouse.row, SELECTION_NORMAL);
break;
+ case BIND_ACTION_SELECT_BEGIN_BLOCK:
+ selection_start(term, seat->mouse.col, seat->mouse.row, SELECTION_BLOCK);
+ break;
+
+ case BIND_ACTION_SELECT_EXTEND: {
+ bool cursor_is_on_grid = seat->mouse.col >= 0 && seat->mouse.row >= 0;
+ if (selection_enabled(term, seat) && cursor_is_on_grid) {
+ selection_extend(
+ seat, term, seat->mouse.col, seat->mouse.row, serial);
+ }
+ break;
+ }
+
case BIND_ACTION_SELECT_WORD:
selection_mark_word(
seat, term, seat->mouse.col, seat->mouse.row, false, serial);
@@ -270,14 +281,10 @@ execute_binding(struct seat *seat, struct terminal *term,
seat, term, seat->mouse.col, seat->mouse.row, true, serial);
break;
- case BIND_ACTION_SELECT_EXTEND: {
- bool cursor_is_on_grid = seat->mouse.col >= 0 && seat->mouse.row >= 0;
- if (selection_enabled(term, seat) && cursor_is_on_grid) {
- selection_extend(
- seat, term, seat->mouse.col, seat->mouse.row, serial);
- }
+ case BIND_ACTION_SELECT_ROW:
+ selection_mark_row(seat, term, seat->mouse.row, serial);
break;
- }
+
case BIND_ACTION_COUNT:
assert(false);
@@ -1279,10 +1286,8 @@ wl_pointer_motion(void *data, struct wl_pointer *wl_pointer,
bool cursor_is_on_grid = seat->mouse.col >= 0 && seat->mouse.row >= 0;
/* Update selection */
- if (seat->mouse.button == BTN_LEFT || seat->mouse.button == BTN_RIGHT) {
- if (cursor_is_on_new_cell || term->selection.end.row < 0)
- selection_update(term, selection_col, selection_row);
- }
+ if (cursor_is_on_new_cell || term->selection.end.row < 0)
+ selection_update(term, selection_col, selection_row);
/* Send mouse event to client application */
if (!term_mouse_grabbed(term, seat) &&