summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-03-21 16:19:58 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-03-21 16:19:58 (GMT)
commitb4a63e993061e493c20387f5ee294ad9482f3cc3 (patch)
tree5bc33653732488ee710e47d375dd86168bf1b623
parent3b45151448f27b0e1173284228008b05a4791b4e (diff)
downloadtk-b4a63e993061e493c20387f5ee294ad9482f3cc3.zip
tk-b4a63e993061e493c20387f5ee294ad9482f3cc3.tar.gz
tk-b4a63e993061e493c20387f5ee294ad9482f3cc3.tar.bz2
Fix mouswheel handling when mouse doesn't have horizontal movement, but this is handled by the driver when using Shift. Could happen for both MacOS as UNIX
-rw-r--r--generic/tkEvent.c2
-rw-r--r--macosx/tkMacOSXMouseEvent.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/generic/tkEvent.c b/generic/tkEvent.c
index bb9b12d..698e9e1 100644
--- a/generic/tkEvent.c
+++ b/generic/tkEvent.c
@@ -1151,7 +1151,7 @@ Tk_HandleEvent(
eventPtr->xany.send_event = -1;
eventPtr->xkey.keycode = (but & 1) ? -120 : 120;
if (but > Button5) {
- eventPtr->xkey.state ^= ShiftMask;
+ eventPtr->xkey.state |= ShiftMask;
}
}
}
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index 746c0c9..7241e13 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -363,7 +363,7 @@ enum {
}
if (fabs(delta) >= 0.6) {
int intDelta = round(delta);
- xEvent.xbutton.state = state ^ ShiftMask;
+ xEvent.xbutton.state = state | ShiftMask;
xEvent.xkey.keycode = WHEEL_DELTA * intDelta;
tsdPtr->hWheelAcc -= intDelta;
xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin));