-/* $OpenBSD: key-string.c,v 1.68 2021/06/16 08:37:58 nicm Exp $ */
+/* $OpenBSD: key-string.c,v 1.69 2022/02/16 18:55:05 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
KEYC_MOUSE_STRING(MOUSEDOWN1, MouseDown1),
KEYC_MOUSE_STRING(MOUSEDOWN2, MouseDown2),
KEYC_MOUSE_STRING(MOUSEDOWN3, MouseDown3),
+ KEYC_MOUSE_STRING(MOUSEDOWN6, MouseDown6),
+ KEYC_MOUSE_STRING(MOUSEDOWN7, MouseDown7),
+ KEYC_MOUSE_STRING(MOUSEDOWN8, MouseDown8),
+ KEYC_MOUSE_STRING(MOUSEDOWN9, MouseDown9),
+ KEYC_MOUSE_STRING(MOUSEDOWN10, MouseDown10),
+ KEYC_MOUSE_STRING(MOUSEDOWN11, MouseDown11),
KEYC_MOUSE_STRING(MOUSEUP1, MouseUp1),
KEYC_MOUSE_STRING(MOUSEUP2, MouseUp2),
KEYC_MOUSE_STRING(MOUSEUP3, MouseUp3),
+ KEYC_MOUSE_STRING(MOUSEUP6, MouseUp6),
+ KEYC_MOUSE_STRING(MOUSEUP7, MouseUp7),
+ KEYC_MOUSE_STRING(MOUSEUP8, MouseUp8),
+ KEYC_MOUSE_STRING(MOUSEUP9, MouseUp9),
+ KEYC_MOUSE_STRING(MOUSEUP10, MouseUp10),
+ KEYC_MOUSE_STRING(MOUSEUP11, MouseUp11),
KEYC_MOUSE_STRING(MOUSEDRAG1, MouseDrag1),
KEYC_MOUSE_STRING(MOUSEDRAG2, MouseDrag2),
KEYC_MOUSE_STRING(MOUSEDRAG3, MouseDrag3),
+ KEYC_MOUSE_STRING(MOUSEDRAG6, MouseDrag6),
+ KEYC_MOUSE_STRING(MOUSEDRAG7, MouseDrag7),
+ KEYC_MOUSE_STRING(MOUSEDRAG8, MouseDrag8),
+ KEYC_MOUSE_STRING(MOUSEDRAG9, MouseDrag9),
+ KEYC_MOUSE_STRING(MOUSEDRAG10, MouseDrag10),
+ KEYC_MOUSE_STRING(MOUSEDRAG11, MouseDrag11),
KEYC_MOUSE_STRING(MOUSEDRAGEND1, MouseDragEnd1),
KEYC_MOUSE_STRING(MOUSEDRAGEND2, MouseDragEnd2),
KEYC_MOUSE_STRING(MOUSEDRAGEND3, MouseDragEnd3),
+ KEYC_MOUSE_STRING(MOUSEDRAGEND6, MouseDragEnd6),
+ KEYC_MOUSE_STRING(MOUSEDRAGEND7, MouseDragEnd7),
+ KEYC_MOUSE_STRING(MOUSEDRAGEND8, MouseDragEnd8),
+ KEYC_MOUSE_STRING(MOUSEDRAGEND9, MouseDragEnd9),
+ KEYC_MOUSE_STRING(MOUSEDRAGEND10, MouseDragEnd10),
+ KEYC_MOUSE_STRING(MOUSEDRAGEND11, MouseDragEnd11),
KEYC_MOUSE_STRING(WHEELUP, WheelUp),
KEYC_MOUSE_STRING(WHEELDOWN, WheelDown),
KEYC_MOUSE_STRING(SECONDCLICK1, SecondClick1),
KEYC_MOUSE_STRING(SECONDCLICK2, SecondClick2),
KEYC_MOUSE_STRING(SECONDCLICK3, SecondClick3),
+ KEYC_MOUSE_STRING(SECONDCLICK6, SecondClick6),
+ KEYC_MOUSE_STRING(SECONDCLICK7, SecondClick7),
+ KEYC_MOUSE_STRING(SECONDCLICK8, SecondClick8),
+ KEYC_MOUSE_STRING(SECONDCLICK9, SecondClick9),
+ KEYC_MOUSE_STRING(SECONDCLICK10, SecondClick10),
+ KEYC_MOUSE_STRING(SECONDCLICK11, SecondClick11),
KEYC_MOUSE_STRING(DOUBLECLICK1, DoubleClick1),
KEYC_MOUSE_STRING(DOUBLECLICK2, DoubleClick2),
KEYC_MOUSE_STRING(DOUBLECLICK3, DoubleClick3),
+ KEYC_MOUSE_STRING(DOUBLECLICK6, DoubleClick6),
+ KEYC_MOUSE_STRING(DOUBLECLICK7, DoubleClick7),
+ KEYC_MOUSE_STRING(DOUBLECLICK8, DoubleClick8),
+ KEYC_MOUSE_STRING(DOUBLECLICK9, DoubleClick9),
+ KEYC_MOUSE_STRING(DOUBLECLICK10, DoubleClick10),
+ KEYC_MOUSE_STRING(DOUBLECLICK11, DoubleClick11),
KEYC_MOUSE_STRING(TRIPLECLICK1, TripleClick1),
KEYC_MOUSE_STRING(TRIPLECLICK2, TripleClick2),
KEYC_MOUSE_STRING(TRIPLECLICK3, TripleClick3),
+ KEYC_MOUSE_STRING(TRIPLECLICK6, TripleClick6),
+ KEYC_MOUSE_STRING(TRIPLECLICK7, TripleClick7),
+ KEYC_MOUSE_STRING(TRIPLECLICK8, TripleClick8),
+ KEYC_MOUSE_STRING(TRIPLECLICK9, TripleClick9),
+ KEYC_MOUSE_STRING(TRIPLECLICK10, TripleClick10),
+ KEYC_MOUSE_STRING(TRIPLECLICK11, TripleClick11)
};
/* Find key string in table. */
-/* $OpenBSD: server-client.c,v 1.390 2021/11/15 10:58:13 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.391 2022/02/16 18:55:05 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
log_debug("double-click at %u,%u", x, y);
} else if ((m->sgr_type != ' ' &&
MOUSE_DRAG(m->sgr_b) &&
- MOUSE_BUTTONS(m->sgr_b) == 3) ||
+ MOUSE_RELEASE(m->sgr_b)) ||
(m->sgr_type == ' ' &&
MOUSE_DRAG(m->b) &&
- MOUSE_BUTTONS(m->b) == 3 &&
- MOUSE_BUTTONS(m->lb) == 3)) {
+ MOUSE_RELEASE(m->b) &&
+ MOUSE_RELEASE(m->lb))) {
type = MOVE;
x = m->x, y = m->y, b = 0;
log_debug("move at %u,%u", x, y);
m->wp = -1;
/* Stop dragging if needed. */
- if (type != DRAG && type != WHEEL && c->tty.mouse_drag_flag) {
+ if (type != DRAG && type != WHEEL && c->tty.mouse_drag_flag != 0) {
if (c->tty.mouse_drag_release != NULL)
c->tty.mouse_drag_release(c, m);
* End a mouse drag by passing a MouseDragEnd key corresponding
* to the button that started the drag.
*/
- switch (c->tty.mouse_drag_flag) {
- case 1:
+ switch (c->tty.mouse_drag_flag - 1) {
+ case MOUSE_BUTTON_1:
if (where == PANE)
key = KEYC_MOUSEDRAGEND1_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_MOUSEDRAGEND1_BORDER;
break;
- case 2:
+ case MOUSE_BUTTON_2:
if (where == PANE)
key = KEYC_MOUSEDRAGEND2_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_MOUSEDRAGEND2_BORDER;
break;
- case 3:
+ case MOUSE_BUTTON_3:
if (where == PANE)
key = KEYC_MOUSEDRAGEND3_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_MOUSEDRAGEND3_BORDER;
break;
+ case MOUSE_BUTTON_6:
+ if (where == PANE)
+ key = KEYC_MOUSEDRAGEND6_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEDRAGEND6_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDRAGEND6_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDRAGEND6_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEDRAGEND6_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEDRAGEND6_BORDER;
+ break;
+ case MOUSE_BUTTON_7:
+ if (where == PANE)
+ key = KEYC_MOUSEDRAGEND7_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEDRAGEND7_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDRAGEND7_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDRAGEND7_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEDRAGEND7_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEDRAGEND7_BORDER;
+ break;
+ case MOUSE_BUTTON_8:
+ if (where == PANE)
+ key = KEYC_MOUSEDRAGEND8_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEDRAGEND8_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDRAGEND8_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDRAGEND8_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEDRAGEND8_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEDRAGEND8_BORDER;
+ break;
+ case MOUSE_BUTTON_9:
+ if (where == PANE)
+ key = KEYC_MOUSEDRAGEND9_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEDRAGEND9_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDRAGEND9_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDRAGEND9_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEDRAGEND9_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEDRAGEND9_BORDER;
+ break;
+ case MOUSE_BUTTON_10:
+ if (where == PANE)
+ key = KEYC_MOUSEDRAGEND10_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEDRAGEND10_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDRAGEND10_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDRAGEND10_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEDRAGEND10_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEDRAGEND10_BORDER;
+ break;
+ case MOUSE_BUTTON_11:
+ if (where == PANE)
+ key = KEYC_MOUSEDRAGEND11_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEDRAGEND11_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDRAGEND11_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDRAGEND11_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEDRAGEND11_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEDRAGEND11_BORDER;
+ break;
default:
key = KEYC_MOUSE;
break;
key = KEYC_DRAGGING;
else {
switch (MOUSE_BUTTONS(b)) {
- case 0:
+ case MOUSE_BUTTON_1:
if (where == PANE)
key = KEYC_MOUSEDRAG1_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_MOUSEDRAG1_BORDER;
break;
- case 1:
+ case MOUSE_BUTTON_2:
if (where == PANE)
key = KEYC_MOUSEDRAG2_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_MOUSEDRAG2_BORDER;
break;
- case 2:
+ case MOUSE_BUTTON_3:
if (where == PANE)
key = KEYC_MOUSEDRAG3_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_MOUSEDRAG3_BORDER;
break;
+ case MOUSE_BUTTON_6:
+ if (where == PANE)
+ key = KEYC_MOUSEDRAG6_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEDRAG6_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDRAG6_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDRAG6_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEDRAG6_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEDRAG6_BORDER;
+ break;
+ case MOUSE_BUTTON_7:
+ if (where == PANE)
+ key = KEYC_MOUSEDRAG7_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEDRAG7_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDRAG7_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDRAG7_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEDRAG7_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEDRAG7_BORDER;
+ break;
+ case MOUSE_BUTTON_8:
+ if (where == PANE)
+ key = KEYC_MOUSEDRAG8_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEDRAG8_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDRAG8_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDRAG8_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEDRAG8_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEDRAG8_BORDER;
+ break;
+ case MOUSE_BUTTON_9:
+ if (where == PANE)
+ key = KEYC_MOUSEDRAG9_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEDRAG9_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDRAG9_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDRAG9_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEDRAG9_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEDRAG9_BORDER;
+ break;
+ case MOUSE_BUTTON_10:
+ if (where == PANE)
+ key = KEYC_MOUSEDRAG10_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEDRAG10_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDRAG10_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDRAG10_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEDRAG10_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEDRAG10_BORDER;
+ break;
+ case MOUSE_BUTTON_11:
+ if (where == PANE)
+ key = KEYC_MOUSEDRAG11_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEDRAG11_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDRAG11_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDRAG11_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEDRAG11_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEDRAG11_BORDER;
+ break;
}
}
break;
case UP:
switch (MOUSE_BUTTONS(b)) {
- case 0:
+ case MOUSE_BUTTON_1:
if (where == PANE)
key = KEYC_MOUSEUP1_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_MOUSEUP1_BORDER;
break;
- case 1:
+ case MOUSE_BUTTON_2:
if (where == PANE)
key = KEYC_MOUSEUP2_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_MOUSEUP2_BORDER;
break;
- case 2:
+ case MOUSE_BUTTON_3:
if (where == PANE)
key = KEYC_MOUSEUP3_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_MOUSEUP3_BORDER;
break;
+ case MOUSE_BUTTON_6:
+ if (where == PANE)
+ key = KEYC_MOUSEUP6_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEUP6_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEUP6_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEUP6_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEUP6_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEUP6_BORDER;
+ break;
+ case MOUSE_BUTTON_7:
+ if (where == PANE)
+ key = KEYC_MOUSEUP7_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEUP7_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEUP7_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEUP7_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEUP7_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEUP7_BORDER;
+ break;
+ case MOUSE_BUTTON_8:
+ if (where == PANE)
+ key = KEYC_MOUSEUP8_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEUP8_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEUP8_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEUP8_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEUP8_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEUP8_BORDER;
+ break;
+ case MOUSE_BUTTON_9:
+ if (where == PANE)
+ key = KEYC_MOUSEUP9_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEUP9_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEUP9_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEUP9_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEUP9_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEUP9_BORDER;
+ break;
+ case MOUSE_BUTTON_10:
+ if (where == PANE)
+ key = KEYC_MOUSEUP1_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEUP1_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEUP1_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEUP1_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEUP1_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEUP1_BORDER;
+ break;
+ case MOUSE_BUTTON_11:
+ if (where == PANE)
+ key = KEYC_MOUSEUP11_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEUP11_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEUP11_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEUP11_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEUP11_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEUP11_BORDER;
+ break;
}
break;
case DOWN:
switch (MOUSE_BUTTONS(b)) {
- case 0:
+ case MOUSE_BUTTON_1:
if (where == PANE)
key = KEYC_MOUSEDOWN1_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_MOUSEDOWN1_BORDER;
break;
- case 1:
+ case MOUSE_BUTTON_2:
if (where == PANE)
key = KEYC_MOUSEDOWN2_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_MOUSEDOWN2_BORDER;
break;
- case 2:
+ case MOUSE_BUTTON_3:
if (where == PANE)
key = KEYC_MOUSEDOWN3_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_MOUSEDOWN3_BORDER;
break;
+ case MOUSE_BUTTON_6:
+ if (where == PANE)
+ key = KEYC_MOUSEDOWN6_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEDOWN6_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDOWN6_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDOWN6_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEDOWN6_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEDOWN6_BORDER;
+ break;
+ case MOUSE_BUTTON_7:
+ if (where == PANE)
+ key = KEYC_MOUSEDOWN7_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEDOWN7_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDOWN7_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDOWN7_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEDOWN7_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEDOWN7_BORDER;
+ break;
+ case MOUSE_BUTTON_8:
+ if (where == PANE)
+ key = KEYC_MOUSEDOWN8_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEDOWN8_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDOWN8_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDOWN8_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEDOWN8_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEDOWN8_BORDER;
+ break;
+ case MOUSE_BUTTON_9:
+ if (where == PANE)
+ key = KEYC_MOUSEDOWN9_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEDOWN9_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDOWN9_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDOWN9_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEDOWN9_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEDOWN9_BORDER;
+ break;
+ case MOUSE_BUTTON_10:
+ if (where == PANE)
+ key = KEYC_MOUSEDOWN10_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEDOWN10_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDOWN10_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDOWN10_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEDOWN10_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEDOWN10_BORDER;
+ break;
+ case MOUSE_BUTTON_11:
+ if (where == PANE)
+ key = KEYC_MOUSEDOWN11_PANE;
+ if (where == STATUS)
+ key = KEYC_MOUSEDOWN11_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDOWN11_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDOWN11_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_MOUSEDOWN11_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_MOUSEDOWN11_BORDER;
+ break;
}
break;
case SECOND:
switch (MOUSE_BUTTONS(b)) {
- case 0:
+ case MOUSE_BUTTON_1:
if (where == PANE)
key = KEYC_SECONDCLICK1_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_SECONDCLICK1_BORDER;
break;
- case 1:
+ case MOUSE_BUTTON_2:
if (where == PANE)
key = KEYC_SECONDCLICK2_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_SECONDCLICK2_BORDER;
break;
- case 2:
+ case MOUSE_BUTTON_3:
if (where == PANE)
key = KEYC_SECONDCLICK3_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_SECONDCLICK3_BORDER;
break;
+ case MOUSE_BUTTON_6:
+ if (where == PANE)
+ key = KEYC_SECONDCLICK6_PANE;
+ if (where == STATUS)
+ key = KEYC_SECONDCLICK6_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_SECONDCLICK6_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_SECONDCLICK6_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_SECONDCLICK6_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_SECONDCLICK6_BORDER;
+ break;
+ case MOUSE_BUTTON_7:
+ if (where == PANE)
+ key = KEYC_SECONDCLICK7_PANE;
+ if (where == STATUS)
+ key = KEYC_SECONDCLICK7_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_SECONDCLICK7_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_SECONDCLICK7_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_SECONDCLICK7_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_SECONDCLICK7_BORDER;
+ break;
+ case MOUSE_BUTTON_8:
+ if (where == PANE)
+ key = KEYC_SECONDCLICK8_PANE;
+ if (where == STATUS)
+ key = KEYC_SECONDCLICK8_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_SECONDCLICK8_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_SECONDCLICK8_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_SECONDCLICK8_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_SECONDCLICK8_BORDER;
+ break;
+ case MOUSE_BUTTON_9:
+ if (where == PANE)
+ key = KEYC_SECONDCLICK9_PANE;
+ if (where == STATUS)
+ key = KEYC_SECONDCLICK9_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_SECONDCLICK9_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_SECONDCLICK9_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_SECONDCLICK9_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_SECONDCLICK9_BORDER;
+ break;
+ case MOUSE_BUTTON_10:
+ if (where == PANE)
+ key = KEYC_SECONDCLICK10_PANE;
+ if (where == STATUS)
+ key = KEYC_SECONDCLICK10_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_SECONDCLICK10_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_SECONDCLICK10_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_SECONDCLICK10_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_SECONDCLICK10_BORDER;
+ break;
+ case MOUSE_BUTTON_11:
+ if (where == PANE)
+ key = KEYC_SECONDCLICK11_PANE;
+ if (where == STATUS)
+ key = KEYC_SECONDCLICK11_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_SECONDCLICK11_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_SECONDCLICK11_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_SECONDCLICK11_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_SECONDCLICK11_BORDER;
+ break;
}
break;
case DOUBLE:
switch (MOUSE_BUTTONS(b)) {
- case 0:
+ case MOUSE_BUTTON_1:
if (where == PANE)
key = KEYC_DOUBLECLICK1_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_DOUBLECLICK1_BORDER;
break;
- case 1:
+ case MOUSE_BUTTON_2:
if (where == PANE)
key = KEYC_DOUBLECLICK2_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_DOUBLECLICK2_BORDER;
break;
- case 2:
+ case MOUSE_BUTTON_3:
if (where == PANE)
key = KEYC_DOUBLECLICK3_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_DOUBLECLICK3_BORDER;
break;
+ case MOUSE_BUTTON_6:
+ if (where == PANE)
+ key = KEYC_DOUBLECLICK6_PANE;
+ if (where == STATUS)
+ key = KEYC_DOUBLECLICK6_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_DOUBLECLICK6_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_DOUBLECLICK6_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_DOUBLECLICK6_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_DOUBLECLICK6_BORDER;
+ break;
+ case MOUSE_BUTTON_7:
+ if (where == PANE)
+ key = KEYC_DOUBLECLICK7_PANE;
+ if (where == STATUS)
+ key = KEYC_DOUBLECLICK7_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_DOUBLECLICK7_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_DOUBLECLICK7_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_DOUBLECLICK7_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_DOUBLECLICK7_BORDER;
+ break;
+ case MOUSE_BUTTON_8:
+ if (where == PANE)
+ key = KEYC_DOUBLECLICK8_PANE;
+ if (where == STATUS)
+ key = KEYC_DOUBLECLICK8_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_DOUBLECLICK8_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_DOUBLECLICK8_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_DOUBLECLICK8_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_DOUBLECLICK8_BORDER;
+ break;
+ case MOUSE_BUTTON_9:
+ if (where == PANE)
+ key = KEYC_DOUBLECLICK9_PANE;
+ if (where == STATUS)
+ key = KEYC_DOUBLECLICK9_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_DOUBLECLICK9_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_DOUBLECLICK9_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_DOUBLECLICK9_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_DOUBLECLICK9_BORDER;
+ break;
+ case MOUSE_BUTTON_10:
+ if (where == PANE)
+ key = KEYC_DOUBLECLICK10_PANE;
+ if (where == STATUS)
+ key = KEYC_DOUBLECLICK10_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_DOUBLECLICK10_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_DOUBLECLICK10_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_DOUBLECLICK10_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_DOUBLECLICK10_BORDER;
+ break;
+ case MOUSE_BUTTON_11:
+ if (where == PANE)
+ key = KEYC_DOUBLECLICK11_PANE;
+ if (where == STATUS)
+ key = KEYC_DOUBLECLICK11_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_DOUBLECLICK11_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_DOUBLECLICK11_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_DOUBLECLICK11_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_DOUBLECLICK11_BORDER;
+ break;
}
break;
case TRIPLE:
switch (MOUSE_BUTTONS(b)) {
- case 0:
+ case MOUSE_BUTTON_1:
if (where == PANE)
key = KEYC_TRIPLECLICK1_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_TRIPLECLICK1_BORDER;
break;
- case 1:
+ case MOUSE_BUTTON_2:
if (where == PANE)
key = KEYC_TRIPLECLICK2_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_TRIPLECLICK2_BORDER;
break;
- case 2:
+ case MOUSE_BUTTON_3:
if (where == PANE)
key = KEYC_TRIPLECLICK3_PANE;
if (where == STATUS)
if (where == BORDER)
key = KEYC_TRIPLECLICK3_BORDER;
break;
+ case MOUSE_BUTTON_6:
+ if (where == PANE)
+ key = KEYC_TRIPLECLICK6_PANE;
+ if (where == STATUS)
+ key = KEYC_TRIPLECLICK6_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_TRIPLECLICK6_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_TRIPLECLICK6_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_TRIPLECLICK6_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_TRIPLECLICK6_BORDER;
+ break;
+ case MOUSE_BUTTON_7:
+ if (where == PANE)
+ key = KEYC_TRIPLECLICK7_PANE;
+ if (where == STATUS)
+ key = KEYC_TRIPLECLICK7_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_TRIPLECLICK7_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_TRIPLECLICK7_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_TRIPLECLICK7_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_TRIPLECLICK7_BORDER;
+ break;
+ case MOUSE_BUTTON_8:
+ if (where == PANE)
+ key = KEYC_TRIPLECLICK8_PANE;
+ if (where == STATUS)
+ key = KEYC_TRIPLECLICK8_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_TRIPLECLICK8_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_TRIPLECLICK8_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_TRIPLECLICK8_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_TRIPLECLICK8_BORDER;
+ break;
+ case MOUSE_BUTTON_9:
+ if (where == PANE)
+ key = KEYC_TRIPLECLICK9_PANE;
+ if (where == STATUS)
+ key = KEYC_TRIPLECLICK9_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_TRIPLECLICK9_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_TRIPLECLICK9_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_TRIPLECLICK9_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_TRIPLECLICK9_BORDER;
+ break;
+ case MOUSE_BUTTON_10:
+ if (where == PANE)
+ key = KEYC_TRIPLECLICK10_PANE;
+ if (where == STATUS)
+ key = KEYC_TRIPLECLICK10_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_TRIPLECLICK10_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_TRIPLECLICK10_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_TRIPLECLICK10_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_TRIPLECLICK10_BORDER;
+ break;
+ case MOUSE_BUTTON_11:
+ if (where == PANE)
+ key = KEYC_TRIPLECLICK11_PANE;
+ if (where == STATUS)
+ key = KEYC_TRIPLECLICK11_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_TRIPLECLICK11_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_TRIPLECLICK11_STATUS_RIGHT;
+ if (where == STATUS_DEFAULT)
+ key = KEYC_TRIPLECLICK11_STATUS_DEFAULT;
+ if (where == BORDER)
+ key = KEYC_TRIPLECLICK11_BORDER;
+ break;
}
break;
}
-/* $OpenBSD: tmux.h,v 1.1159 2022/02/15 13:03:02 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.1160 2022/02/16 18:55:05 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
KEYC_MOUSE_KEY(MOUSEDOWN1),
KEYC_MOUSE_KEY(MOUSEDOWN2),
KEYC_MOUSE_KEY(MOUSEDOWN3),
+ KEYC_MOUSE_KEY(MOUSEDOWN6),
+ KEYC_MOUSE_KEY(MOUSEDOWN7),
+ KEYC_MOUSE_KEY(MOUSEDOWN8),
+ KEYC_MOUSE_KEY(MOUSEDOWN9),
+ KEYC_MOUSE_KEY(MOUSEDOWN10),
+ KEYC_MOUSE_KEY(MOUSEDOWN11),
KEYC_MOUSE_KEY(MOUSEUP1),
KEYC_MOUSE_KEY(MOUSEUP2),
KEYC_MOUSE_KEY(MOUSEUP3),
+ KEYC_MOUSE_KEY(MOUSEUP6),
+ KEYC_MOUSE_KEY(MOUSEUP7),
+ KEYC_MOUSE_KEY(MOUSEUP8),
+ KEYC_MOUSE_KEY(MOUSEUP9),
+ KEYC_MOUSE_KEY(MOUSEUP10),
+ KEYC_MOUSE_KEY(MOUSEUP11),
KEYC_MOUSE_KEY(MOUSEDRAG1),
KEYC_MOUSE_KEY(MOUSEDRAG2),
KEYC_MOUSE_KEY(MOUSEDRAG3),
+ KEYC_MOUSE_KEY(MOUSEDRAG6),
+ KEYC_MOUSE_KEY(MOUSEDRAG7),
+ KEYC_MOUSE_KEY(MOUSEDRAG8),
+ KEYC_MOUSE_KEY(MOUSEDRAG9),
+ KEYC_MOUSE_KEY(MOUSEDRAG10),
+ KEYC_MOUSE_KEY(MOUSEDRAG11),
KEYC_MOUSE_KEY(MOUSEDRAGEND1),
KEYC_MOUSE_KEY(MOUSEDRAGEND2),
KEYC_MOUSE_KEY(MOUSEDRAGEND3),
+ KEYC_MOUSE_KEY(MOUSEDRAGEND6),
+ KEYC_MOUSE_KEY(MOUSEDRAGEND7),
+ KEYC_MOUSE_KEY(MOUSEDRAGEND8),
+ KEYC_MOUSE_KEY(MOUSEDRAGEND9),
+ KEYC_MOUSE_KEY(MOUSEDRAGEND10),
+ KEYC_MOUSE_KEY(MOUSEDRAGEND11),
KEYC_MOUSE_KEY(WHEELUP),
KEYC_MOUSE_KEY(WHEELDOWN),
KEYC_MOUSE_KEY(SECONDCLICK1),
KEYC_MOUSE_KEY(SECONDCLICK2),
KEYC_MOUSE_KEY(SECONDCLICK3),
+ KEYC_MOUSE_KEY(SECONDCLICK6),
+ KEYC_MOUSE_KEY(SECONDCLICK7),
+ KEYC_MOUSE_KEY(SECONDCLICK8),
+ KEYC_MOUSE_KEY(SECONDCLICK9),
+ KEYC_MOUSE_KEY(SECONDCLICK10),
+ KEYC_MOUSE_KEY(SECONDCLICK11),
KEYC_MOUSE_KEY(DOUBLECLICK1),
KEYC_MOUSE_KEY(DOUBLECLICK2),
KEYC_MOUSE_KEY(DOUBLECLICK3),
+ KEYC_MOUSE_KEY(DOUBLECLICK6),
+ KEYC_MOUSE_KEY(DOUBLECLICK7),
+ KEYC_MOUSE_KEY(DOUBLECLICK8),
+ KEYC_MOUSE_KEY(DOUBLECLICK9),
+ KEYC_MOUSE_KEY(DOUBLECLICK10),
+ KEYC_MOUSE_KEY(DOUBLECLICK11),
KEYC_MOUSE_KEY(TRIPLECLICK1),
KEYC_MOUSE_KEY(TRIPLECLICK2),
KEYC_MOUSE_KEY(TRIPLECLICK3),
+ KEYC_MOUSE_KEY(TRIPLECLICK6),
+ KEYC_MOUSE_KEY(TRIPLECLICK7),
+ KEYC_MOUSE_KEY(TRIPLECLICK8),
+ KEYC_MOUSE_KEY(TRIPLECLICK9),
+ KEYC_MOUSE_KEY(TRIPLECLICK10),
+ KEYC_MOUSE_KEY(TRIPLECLICK11),
/* Backspace key. */
KEYC_BSPACE,
RB_HEAD(sessions, session);
/* Mouse button masks. */
-#define MOUSE_MASK_BUTTONS 3
+#define MOUSE_MASK_BUTTONS 195
#define MOUSE_MASK_SHIFT 4
#define MOUSE_MASK_META 8
#define MOUSE_MASK_CTRL 16
#define MOUSE_MASK_DRAG 32
-#define MOUSE_MASK_WHEEL 64
#define MOUSE_MASK_MODIFIERS (MOUSE_MASK_SHIFT|MOUSE_MASK_META|MOUSE_MASK_CTRL)
-/* Mouse wheel states. */
-#define MOUSE_WHEEL_UP 0
-#define MOUSE_WHEEL_DOWN 1
+/* Mouse wheel type. */
+#define MOUSE_WHEEL_UP 64
+#define MOUSE_WHEEL_DOWN 65
+
+/* Mouse button type. */
+#define MOUSE_BUTTON_1 0
+#define MOUSE_BUTTON_2 1
+#define MOUSE_BUTTON_3 2
+#define MOUSE_BUTTON_6 66
+#define MOUSE_BUTTON_7 67
+#define MOUSE_BUTTON_8 128
+#define MOUSE_BUTTON_9 129
+#define MOUSE_BUTTON_10 130
+#define MOUSE_BUTTON_11 131
/* Mouse helpers. */
#define MOUSE_BUTTONS(b) ((b) & MOUSE_MASK_BUTTONS)
-#define MOUSE_WHEEL(b) ((b) & MOUSE_MASK_WHEEL)
+#define MOUSE_WHEEL(b) \
+ (((b) & MOUSE_MASK_BUTTONS) == MOUSE_WHEEL_UP || \
+ ((b) & MOUSE_MASK_BUTTONS) == MOUSE_WHEEL_DOWN)
#define MOUSE_DRAG(b) ((b) & MOUSE_MASK_DRAG)
#define MOUSE_RELEASE(b) (((b) & MOUSE_MASK_BUTTONS) == 3)