diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-08-19 21:53:59 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-08-19 21:53:59 (GMT) |
commit | b3d84c8374a4c16f82007407a76c8357fecb8e11 (patch) | |
tree | ae9acdbefb8a01f9832702cff40cd4790a178722 /generic/tkEvent.c | |
parent | dff6d16fcad7edb9640b8459ddd29d6415c6625e (diff) | |
download | tk-b3d84c8374a4c16f82007407a76c8357fecb8e11.zip tk-b3d84c8374a4c16f82007407a76c8357fecb8e11.tar.gz tk-b3d84c8374a4c16f82007407a76c8357fecb8e11.tar.bz2 |
Much simpler (still Experimental) implementation of RFE-5da1d76e01. Just translate 6/7 to Shift-4/5
Diffstat (limited to 'generic/tkEvent.c')
-rw-r--r-- | generic/tkEvent.c | 11 |
1 files changed, 10 insertions, 1 deletions
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; |