Windows users who may not have a middle button at all, but I've
replicated it in GTK to maintain cross-platform consistency.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4166
cda61777-01e9-0310-a592-
d414129be87e
if (event->type != GDK_BUTTON_PRESS)
return TRUE;
if (event->type != GDK_BUTTON_PRESS)
return TRUE;
- if (event->button == 1)
- button = LEFT_BUTTON;
- else if (event->button == 2)
+ if (event->button == 2 || (event->state & GDK_SHIFT_MASK))
+ else if (event->button == 1)
+ button = LEFT_BUTTON;
else if (event->button == 3)
button = RIGHT_BUTTON;
else
else if (event->button == 3)
button = RIGHT_BUTTON;
else
case WM_LBUTTONDOWN:
case WM_RBUTTONDOWN:
case WM_MBUTTONDOWN:
case WM_LBUTTONDOWN:
case WM_RBUTTONDOWN:
case WM_MBUTTONDOWN:
- if (!midend_process_key(fe->me, LOWORD(lParam), HIWORD(lParam),
- (message == WM_LBUTTONDOWN ? LEFT_BUTTON :
- message == WM_RBUTTONDOWN ? RIGHT_BUTTON :
- MIDDLE_BUTTON)))
- PostQuitMessage(0);
-
+ {
+ int button;
+
+ /*
+ * Shift-clicks count as middle-clicks, since otherwise
+ * two-button Windows users won't have any kind of
+ * middle click to use.
+ */
+ if (message == WM_MBUTTONDOWN || (wParam & MK_SHIFT))
+ button = MIDDLE_BUTTON;
+ else if (message == WM_LBUTTONDOWN)
+ button = LEFT_BUTTON;
+ else
+ button = RIGHT_BUTTON;
+
+ if (!midend_process_key(fe->me, LOWORD(lParam),
+ HIWORD(lParam), button))
+ PostQuitMessage(0);
+ }
break;
case WM_CHAR:
if (!midend_process_key(fe->me, 0, 0, (unsigned char)wParam))
break;
case WM_CHAR:
if (!midend_process_key(fe->me, 0, 0, (unsigned char)wParam))