Mercurial > dwindows
comparison gtk3/dw.c @ 2618:156ad91481eb
WARNING: Standardize button press and release button parameter values.
This may break existing code using 3rd mouse button press/release events.
The motion callback and OS/2 had been passing the 3rd mouse button as value 4.
Other platforms were passing it as value 3. Since button/press and release
events only have a single button values 1,2,3 were unique... but OS/2 was
passing the mask value instead, making these not work cross platform.
I decided to make the button press/release and motion events all function the
same. Passing the mask values instead of button numbers. This change will
only affect button 3 on button press or release events on Windows, Mac and GTK.
OS/2 already functioned this way, iOS and Android do not support button 3.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 23 Jul 2021 20:26:56 +0000 |
parents | 2acc7ba5dea0 |
children | 401a3b9f21ba |
comparison
equal
deleted
inserted
replaced
2617:d17e3fb76bde | 2618:156ad91481eb |
---|---|
1358 int retval = FALSE; | 1358 int retval = FALSE; |
1359 | 1359 |
1360 if(work.window) | 1360 if(work.window) |
1361 { | 1361 { |
1362 int (*buttonfunc)(HWND, int, int, int, void *) = work.func; | 1362 int (*buttonfunc)(HWND, int, int, int, void *) = work.func; |
1363 int mybutton = event->button; | 1363 int mybutton = DW_BUTTON1_MASK; |
1364 | 1364 |
1365 if(event->button == 3) | 1365 if(event->button == 3) |
1366 mybutton = 2; | 1366 mybutton = DW_BUTTON2_MASK; |
1367 else if(event->button == 2) | 1367 else if(event->button == 2) |
1368 mybutton = 3; | 1368 mybutton = DW_BUTTON3_MASK; |
1369 | 1369 |
1370 retval = buttonfunc(work.window, event->x, event->y, mybutton, work.data); | 1370 retval = buttonfunc(work.window, event->x, event->y, mybutton, work.data); |
1371 } | 1371 } |
1372 return retval; | 1372 return retval; |
1373 } | 1373 } |
1378 int retval = FALSE; | 1378 int retval = FALSE; |
1379 | 1379 |
1380 if(work.window) | 1380 if(work.window) |
1381 { | 1381 { |
1382 int (*buttonfunc)(HWND, int, int, int, void *) = work.func; | 1382 int (*buttonfunc)(HWND, int, int, int, void *) = work.func; |
1383 int mybutton = event->button; | 1383 int mybutton = DW_BUTTON3_MASK; |
1384 | 1384 |
1385 if(event->button == 3) | 1385 if(event->button == 3) |
1386 mybutton = 2; | 1386 mybutton = DW_BUTTON2_MASK; |
1387 else if(event->button == 2) | 1387 else if(event->button == 2) |
1388 mybutton = 3; | 1388 mybutton = DW_BUTTON3_MASK; |
1389 | 1389 |
1390 retval = buttonfunc(work.window, event->x, event->y, mybutton, work.data); | 1390 retval = buttonfunc(work.window, event->x, event->y, mybutton, work.data); |
1391 } | 1391 } |
1392 return retval; | 1392 return retval; |
1393 } | 1393 } |