comparison src/testing.c @ 28297:4190b932e6ca v8.2.4674

patch 8.2.4674: cannot force getting MouseMove events Commit: https://github.com/vim/vim/commit/c4cb544cd5beaa864b3893e4b8d0085393c7dbce Author: Ernie Rael <errael@raelity.com> Date: Sun Apr 3 15:47:28 2022 +0100 patch 8.2.4674: cannot force getting MouseMove events Problem: Cannot force getting MouseMove events. Solution: Add the 'mousemoveevent' option with implementaiton for the GUI. (Ernie Rael, closes #10044)
author Bram Moolenaar <Bram@vim.org>
date Sun, 03 Apr 2022 17:00:04 +0200
parents 3b2c75c0a7ab
children 62cc3b60493b
comparison
equal deleted inserted replaced
28296:b87dde76b66b 28297:4190b932e6ca
1366 int button; 1366 int button;
1367 int row; 1367 int row;
1368 int col; 1368 int col;
1369 int repeated_click; 1369 int repeated_click;
1370 int_u mods; 1370 int_u mods;
1371 1371 int move;
1372 if (dict_find(args, (char_u *)"button", -1) == NULL 1372
1373 || dict_find(args, (char_u *)"row", -1) == NULL 1373 if (dict_find(args, (char_u *)"row", -1) == NULL
1374 || dict_find(args, (char_u *)"col", -1) == NULL 1374 || dict_find(args, (char_u *)"col", -1) == NULL)
1375 return FALSE;
1376
1377 // Note: "move" is optional, requires fewer arguments
1378 move = (int)dict_get_bool(args, (char_u *)"move", FALSE);
1379
1380 if (!move && (dict_find(args, (char_u *)"button", -1) == NULL
1375 || dict_find(args, (char_u *)"multiclick", -1) == NULL 1381 || dict_find(args, (char_u *)"multiclick", -1) == NULL
1376 || dict_find(args, (char_u *)"modifiers", -1) == NULL) 1382 || dict_find(args, (char_u *)"modifiers", -1) == NULL))
1377 return FALSE; 1383 return FALSE;
1378 1384
1379 button = (int)dict_get_number(args, (char_u *)"button");
1380 row = (int)dict_get_number(args, (char_u *)"row"); 1385 row = (int)dict_get_number(args, (char_u *)"row");
1381 col = (int)dict_get_number(args, (char_u *)"col"); 1386 col = (int)dict_get_number(args, (char_u *)"col");
1382 repeated_click = (int)dict_get_number(args, (char_u *)"multiclick"); 1387
1383 mods = (int)dict_get_number(args, (char_u *)"modifiers"); 1388 if (move)
1384 1389 gui_mouse_moved(col, row);
1385 gui_send_mouse_event(button, TEXT_X(col - 1), TEXT_Y(row - 1), 1390 else
1391 {
1392 button = (int)dict_get_number(args, (char_u *)"button");
1393 repeated_click = (int)dict_get_number(args, (char_u *)"multiclick");
1394 mods = (int)dict_get_number(args, (char_u *)"modifiers");
1395
1396 gui_send_mouse_event(button, TEXT_X(col - 1), TEXT_Y(row - 1),
1386 repeated_click, mods); 1397 repeated_click, mods);
1398 }
1399
1387 return TRUE; 1400 return TRUE;
1388 } 1401 }
1389 1402
1390 static int 1403 static int
1391 test_gui_scrollbar(dict_T *args) 1404 test_gui_scrollbar(dict_T *args)