From b3d84c8374a4c16f82007407a76c8357fecb8e11 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 19 Aug 2019 21:53:59 +0000 Subject: Much simpler (still Experimental) implementation of RFE-5da1d76e01. Just translate 6/7 to Shift-4/5 --- generic/tkEvent.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/generic/tkEvent.c b/generic/tkEvent.c index 56b32af..f2393f2 100644 --- a/generic/tkEvent.c +++ b/generic/tkEvent.c @@ -578,14 +578,23 @@ UpdateButtonEventState( case ButtonPress: dispPtr = TkGetDisplay(eventPtr->xbutton.display); dispPtr->mouseButtonWindow = eventPtr->xbutton.window; - eventPtr->xbutton.state |= dispPtr->mouseButtonState; + if ((eventPtr->xbutton.button >= 6) && (eventPtr->xbutton.button <= 7)) { + /* In case of X11, translate mouse buttons 6/7 to Shift-4/5 */ + eventPtr->xbutton.button -= 2; + eventPtr->xbutton.state |= ShiftMask; + } + eventPtr->xbutton.state |= dispPtr->mouseButtonState; dispPtr->mouseButtonState |= TkGetButtonMask(eventPtr->xbutton.button); break; case ButtonRelease: dispPtr = TkGetDisplay(eventPtr->xbutton.display); dispPtr->mouseButtonWindow = None; + if ((eventPtr->xbutton.button >= 6) && (eventPtr->xbutton.button <= 7)) { + /* In case of X11, translate mouse buttons 6/7 to Shift-4/5 */ + eventPtr->xbutton.button -= 2; + } dispPtr->mouseButtonState &= ~TkGetButtonMask(eventPtr->xbutton.button); eventPtr->xbutton.state |= dispPtr->mouseButtonState; break; -- cgit v0.12