diff options
author | Mattias Andrée <maandree@kth.se> | 2021-04-10 13:36:35 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-04-10 13:36:35 +0200 |
commit | dccdf5ff4286ce22b32c18513b3ae53288fcfb5f (patch) | |
tree | 489b3cdf83a4b6ab9e03494f54e3f00080a4ccfe | |
parent | Add more tests and fixes (diff) | |
download | libterminput-dccdf5ff4286ce22b32c18513b3ae53288fcfb5f.tar.gz libterminput-dccdf5ff4286ce22b32c18513b3ae53288fcfb5f.tar.bz2 libterminput-dccdf5ff4286ce22b32c18513b3ae53288fcfb5f.tar.xz |
Add tests for mouse events
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r-- | libterminput.c | 11 | ||||
-rw-r--r-- | test.c | 134 |
2 files changed, 141 insertions, 4 deletions
diff --git a/libterminput.c b/libterminput.c index 960967d..5758be0 100644 --- a/libterminput.c +++ b/libterminput.c @@ -6,6 +6,7 @@ #include <limits.h> #include <string.h> #include <unistd.h> +#include <stdio.h> struct input { @@ -330,7 +331,7 @@ parse_sequence(union libterminput_input *input, struct libterminput_state *ctx) case 'M': if (ctx->flags & LIBTERMINPUT_MACRO_ON_CSI_M) { input->keypress.key = LIBTERMINPUT_MACRO; - } else if (nnums >= 3) { /* TODO test */ + } else if (nnums >= 3) { /* Parsing for \e[?1000;1015h output. */ nums[0] -= 32ULL; decimal_mouse_tracking_set_press: @@ -338,15 +339,17 @@ parse_sequence(union libterminput_input *input, struct libterminput_state *ctx) decimal_mouse_tracking: input->mouseevent.type = LIBTERMINPUT_MOUSEEVENT; input->mouseevent.x = (size_t)nums[1] + (size_t)!nums[1]; - input->mouseevent.y = (size_t)nums[2] + (size_t)!nums[3]; + input->mouseevent.y = (size_t)nums[2] + (size_t)!nums[2]; input->mouseevent.mods = (enum libterminput_mod)((nums[0] >> 2) & 7ULL); if (nums[0] & 32) input->mouseevent.event = LIBTERMINPUT_MOTION; nums[0] = (nums[0] & 3ULL) | ((nums[0] >> 4) & ~3ULL); if (nums[0] < 4) { nums[0] = (nums[0] + 1) & 3; - if (!nums[0] && input->mouseevent.event == LIBTERMINPUT_PRESS) + if (!nums[0] && input->mouseevent.event == LIBTERMINPUT_PRESS) { input->mouseevent.event = LIBTERMINPUT_RELEASE; + nums[0] = 1; + } } input->mouseevent.button = (enum libterminput_button)nums[0]; } else if (!nnums & !(ctx->flags & LIBTERMINPUT_DECSET_1005)) { /* TODO test */ @@ -579,7 +582,7 @@ parse_sequence(union libterminput_input *input, struct libterminput_state *ctx) case 'D': input->keypress.key = LIBTERMINPUT_F4; break; case 'E': input->keypress.key = LIBTERMINPUT_F5; break; default: - if (ctx->key[1] == '<' && (ctx->key[2] == 'M' || ctx->key[2] == 'm') && nnums >= 3) { /* TODO test */ + if (ctx->key[1] == '<' && (ctx->key[2] == 'M' || ctx->key[2] == 'm') && nnums >= 3) { /* Parsing for \e[?1003;1006h output. */ input->mouseevent.event = LIBTERMINPUT_PRESS; if (ctx->key[2] == 'm') @@ -244,6 +244,16 @@ main(void) TEST(input.keypress.key == (KEY));\ } while (0) +#define MOUSE(STR, EV, BTN, MODS, X, Y)\ + do {\ + TYPE(STR, LIBTERMINPUT_MOUSEEVENT);\ + TEST(input.mouseevent.button == (BTN));\ + TEST(input.mouseevent.mods == (MODS));\ + TEST(input.mouseevent.event == (EV));\ + TEST(input.mouseevent.x == (X));\ + TEST(input.mouseevent.y == (Y));\ + } while (0) + char buffer[512], numbuf[3 * sizeof(int) + 2]; struct libterminput_state ctx; union libterminput_input input; @@ -469,6 +479,130 @@ main(void) TEST(input.keypress.times == 1); TEST(!strcmp(input.keypress.symbol, " ")); + MOUSE("\033[32;1;2M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON1, 0, 1, 2); + MOUSE("\033[33;61;19M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON2, 0, 61, 19); + MOUSE("\033[34;6115;1559M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON3, 0, 6115, 1559); + MOUSE("\033[35;0;0M", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON1, 0, 1, 1); + MOUSE("\033[36;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[37;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[38;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[39;5;6M", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[40;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_META, 5, 6); + MOUSE("\033[41;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_META, 5, 6); + MOUSE("\033[42;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_META, 5, 6); + MOUSE("\033[43;5;6M", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_META, 5, 6); + MOUSE("\033[44;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_META | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[45;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_META | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[46;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_META | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[47;5;6M", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_META | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[48;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_CTRL, 5, 6); + MOUSE("\033[49;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_CTRL, 5, 6); + MOUSE("\033[50;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_CTRL, 5, 6); + MOUSE("\033[51;5;6M", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_CTRL, 5, 6); + MOUSE("\033[52;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_CTRL | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[53;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_CTRL | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[54;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_CTRL | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[55;5;6M", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_CTRL | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[56;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_CTRL | LIBTERMINPUT_META, 5, 6); + MOUSE("\033[57;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_CTRL | LIBTERMINPUT_META, 5, 6); + MOUSE("\033[58;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_CTRL | LIBTERMINPUT_META, 5, 6); + MOUSE("\033[59;5;6M", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_CTRL | LIBTERMINPUT_META, 5, 6); + MOUSE("\033[64;5;6M", LIBTERMINPUT_MOTION, LIBTERMINPUT_BUTTON1, 0, 5, 6); + MOUSE("\033[65;5;6M", LIBTERMINPUT_MOTION, LIBTERMINPUT_BUTTON2, 0, 5, 6); + MOUSE("\033[66;5;6M", LIBTERMINPUT_MOTION, LIBTERMINPUT_BUTTON3, 0, 5, 6); + MOUSE("\033[67;5;6M", LIBTERMINPUT_MOTION, LIBTERMINPUT_NO_BUTTON, 0, 5, 6); + MOUSE("\033[68;5;6M", LIBTERMINPUT_MOTION, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[69;5;6M", LIBTERMINPUT_MOTION, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[70;5;6M", LIBTERMINPUT_MOTION, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[71;5;6M", LIBTERMINPUT_MOTION, LIBTERMINPUT_NO_BUTTON, LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[96;1;2M", LIBTERMINPUT_PRESS, LIBTERMINPUT_SCROLL_UP, 0, 1, 2); + MOUSE("\033[97;1;2M", LIBTERMINPUT_PRESS, LIBTERMINPUT_SCROLL_DOWN, 0, 1, 2); + MOUSE("\033[98;1;2M", LIBTERMINPUT_PRESS, LIBTERMINPUT_SCROLL_LEFT, 0, 1, 2); + MOUSE("\033[99;1;2M", LIBTERMINPUT_PRESS, LIBTERMINPUT_SCROLL_RIGHT, 0, 1, 2); + MOUSE("\033[160;1;2M", LIBTERMINPUT_PRESS, LIBTERMINPUT_XBUTTON1, 0, 1, 2); + MOUSE("\033[161;1;2M", LIBTERMINPUT_PRESS, LIBTERMINPUT_XBUTTON2, 0, 1, 2); + MOUSE("\033[162;1;2M", LIBTERMINPUT_PRESS, LIBTERMINPUT_XBUTTON3, 0, 1, 2); + MOUSE("\033[163;1;2M", LIBTERMINPUT_PRESS, LIBTERMINPUT_XBUTTON4, 0, 1, 2); + + MOUSE("\033[<0;1;2M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON1, 0, 1, 2); + MOUSE("\033[<1;61;19M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON2, 0, 61, 19); + MOUSE("\033[<2;6115;1559M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON3, 0, 6115, 1559); + MOUSE("\033[<4;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<5;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<6;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<8;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_META, 5, 6); + MOUSE("\033[<9;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_META, 5, 6); + MOUSE("\033[<10;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_META, 5, 6); + MOUSE("\033[<12;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_META | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<13;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_META | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<14;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_META | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<16;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_CTRL, 5, 6); + MOUSE("\033[<17;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_CTRL, 5, 6); + MOUSE("\033[<18;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_CTRL, 5, 6); + MOUSE("\033[<20;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_CTRL | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<21;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_CTRL | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<22;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_CTRL | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<24;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_CTRL | LIBTERMINPUT_META, 5, 6); + MOUSE("\033[<25;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_CTRL | LIBTERMINPUT_META, 5, 6); + MOUSE("\033[<26;5;6M", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_CTRL | LIBTERMINPUT_META, 5, 6); + MOUSE("\033[<32;5;6M", LIBTERMINPUT_MOTION, LIBTERMINPUT_BUTTON1, 0, 5, 6); + MOUSE("\033[<33;5;6M", LIBTERMINPUT_MOTION, LIBTERMINPUT_BUTTON2, 0, 5, 6); + MOUSE("\033[<34;5;6M", LIBTERMINPUT_MOTION, LIBTERMINPUT_BUTTON3, 0, 5, 6); + MOUSE("\033[<35;5;6M", LIBTERMINPUT_MOTION, LIBTERMINPUT_NO_BUTTON, 0, 5, 6); + MOUSE("\033[<36;5;6M", LIBTERMINPUT_MOTION, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<37;5;6M", LIBTERMINPUT_MOTION, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<38;5;6M", LIBTERMINPUT_MOTION, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<39;5;6M", LIBTERMINPUT_MOTION, LIBTERMINPUT_NO_BUTTON, LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<64;1;2M", LIBTERMINPUT_PRESS, LIBTERMINPUT_SCROLL_UP, 0, 1, 2); + MOUSE("\033[<65;1;2M", LIBTERMINPUT_PRESS, LIBTERMINPUT_SCROLL_DOWN, 0, 1, 2); + MOUSE("\033[<66;1;2M", LIBTERMINPUT_PRESS, LIBTERMINPUT_SCROLL_LEFT, 0, 1, 2); + MOUSE("\033[<67;1;2M", LIBTERMINPUT_PRESS, LIBTERMINPUT_SCROLL_RIGHT, 0, 1, 2); + MOUSE("\033[<128;1;2M", LIBTERMINPUT_PRESS, LIBTERMINPUT_XBUTTON1, 0, 1, 2); + MOUSE("\033[<129;1;2M", LIBTERMINPUT_PRESS, LIBTERMINPUT_XBUTTON2, 0, 1, 2); + MOUSE("\033[<130;1;2M", LIBTERMINPUT_PRESS, LIBTERMINPUT_XBUTTON3, 0, 1, 2); + MOUSE("\033[<131;1;2M", LIBTERMINPUT_PRESS, LIBTERMINPUT_XBUTTON4, 0, 1, 2); + + MOUSE("\033[<0;1;2m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON1, 0, 1, 2); + MOUSE("\033[<1;61;19m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON2, 0, 61, 19); + MOUSE("\033[<2;6115;1559m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON3, 0, 6115, 1559); + MOUSE("\033[<4;5;6m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<5;5;6m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<6;5;6m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<8;5;6m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_META, 5, 6); + MOUSE("\033[<9;5;6m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_META, 5, 6); + MOUSE("\033[<10;5;6m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_META, 5, 6); + MOUSE("\033[<12;5;6m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_META | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<13;5;6m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_META | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<14;5;6m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_META | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<16;5;6m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_CTRL, 5, 6); + MOUSE("\033[<17;5;6m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_CTRL, 5, 6); + MOUSE("\033[<18;5;6m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_CTRL, 5, 6); + MOUSE("\033[<20;5;6m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_CTRL | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<21;5;6m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_CTRL | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<22;5;6m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_CTRL | LIBTERMINPUT_SHIFT, 5, 6); + MOUSE("\033[<24;5;6m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON1, LIBTERMINPUT_CTRL | LIBTERMINPUT_META, 5, 6); + MOUSE("\033[<25;5;6m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON2, LIBTERMINPUT_CTRL | LIBTERMINPUT_META, 5, 6); + MOUSE("\033[<26;5;6m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON3, LIBTERMINPUT_CTRL | LIBTERMINPUT_META, 5, 6); + MOUSE("\033[<66;1;2m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_SCROLL_LEFT, 0, 1, 2); + MOUSE("\033[<67;1;2m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_SCROLL_RIGHT, 0, 1, 2); + MOUSE("\033[<128;1;2m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_XBUTTON1, 0, 1, 2); + MOUSE("\033[<129;1;2m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_XBUTTON2, 0, 1, 2); + MOUSE("\033[<130;1;2m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_XBUTTON3, 0, 1, 2); + MOUSE("\033[<131;1;2m", LIBTERMINPUT_RELEASE, LIBTERMINPUT_XBUTTON4, 0, 1, 2); + + MOUSE("\033[M !#", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON1, 0, 1, 3); + MOUSE("\033[M!#!", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON2, 0, 3, 1); + MOUSE("\033[M\"#!", LIBTERMINPUT_PRESS, LIBTERMINPUT_BUTTON3, 0, 3, 1); + MOUSE("\033[M#!#", LIBTERMINPUT_RELEASE, LIBTERMINPUT_BUTTON1, 0, 1, 3); +#ifdef TODO + MOUSE("\033[\x80 !#", LIBTERMINPUT_PRESS, LIBTERMINPUT_XBUTTON1, 0, 1, 3); + MOUSE("\033[\x84 !#", LIBTERMINPUT_PRESS, LIBTERMINPUT_XBUTTON1, LIBTERMINPUT_SHIFT, 1, 3); + MOUSE("\033[\x88 !#", LIBTERMINPUT_PRESS, LIBTERMINPUT_XBUTTON1, LIBTERMINPUT_META, 1, 3); + MOUSE("\033[\x8C !#", LIBTERMINPUT_PRESS, LIBTERMINPUT_XBUTTON1, LIBTERMINPUT_SHIFT | LIBTERMINPUT_META, 1, 3); + MOUSE("\033[\x90 !#", LIBTERMINPUT_PRESS, LIBTERMINPUT_XBUTTON1, LIBTERMINPUT_CTRL, 1, 3); + MOUSE("\033[\x91 !#", LIBTERMINPUT_PRESS, LIBTERMINPUT_XBUTTON2, LIBTERMINPUT_CTRL, 1, 3); +#endif + close(fds[1]); TEST(libterminput_read(fds[0], &input, &ctx) == 0); close(fds[0]); |