summaryrefslogtreecommitdiffstats
path: root/input.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2010-12-29 21:49:06 +0000
committerNicholas Marriott <nicm@openbsd.org>2010-12-29 21:49:06 +0000
commitf7c42c21bacf84af52079b239a18294851fbdb3a (patch)
treec5d086441c15ac8629880b2043f95ea3758a719d /input.c
parent230e39ec3558142c94858efae53c36ab0efbcf59 (diff)
Support all four of the xterm mouse modes. Based on a diff from hsim at
gmx.li.
Diffstat (limited to 'input.c')
-rw-r--r--input.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/input.c b/input.c
index cbcdd83c..49224e0e 100644
--- a/input.c
+++ b/input.c
@@ -953,7 +953,7 @@ input_esc_dispatch(struct input_ctx *ictx)
screen_write_insertmode(sctx, 0);
screen_write_kcursormode(sctx, 0);
screen_write_kkeypadmode(sctx, 0);
- screen_write_mousemode(sctx, 0);
+ screen_write_mousemode_off(sctx);
screen_write_clearscreen(sctx);
screen_write_cursormove(sctx, 0, 0);
@@ -1156,7 +1156,10 @@ input_csi_dispatch(struct input_ctx *ictx)
screen_write_cursormode(&ictx->ctx, 0);
break;
case 1000:
- screen_write_mousemode(&ictx->ctx, 0);
+ case 1001:
+ case 1002:
+ case 1003:
+ screen_write_mousemode_off(&ictx->ctx);
break;
case 1049:
window_pane_alternate_off(wp, &ictx->cell);
@@ -1192,7 +1195,19 @@ input_csi_dispatch(struct input_ctx *ictx)
screen_write_cursormode(&ictx->ctx, 1);
break;
case 1000:
- screen_write_mousemode(&ictx->ctx, 1);
+ screen_write_mousemode_on(
+ &ictx->ctx, MODE_MOUSE_STANDARD);
+ break;
+ case 1001:
+ screen_write_mousemode_on(
+ &ictx->ctx, MODE_MOUSE_HIGHLIGHT);
+ break;
+ case 1002:
+ screen_write_mousemode_on(
+ &ictx->ctx, MODE_MOUSE_BUTTON);
+ break;
+ case 1003:
+ screen_write_mousemode_on(&ictx->ctx, MODE_MOUSE_ANY);
break;
case 1049:
window_pane_alternate_on(wp, &ictx->cell);