Tk Source Code

Check-in [77c390ba]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Patch by Arjen sent to core 2018-09-21
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | tip474-uniform-mouse-wheel
Files: files | file ages | folders
SHA3-256: 77c390bae2700c72d4754e7f77339b959899fbcca31ff463f507aa2e1bb35c5e
User & Date: oehhar 2018-09-22 17:59:03
References
2019-07-20
14:52 Ticket [1fb7af62] Add support for buttons 4 and 5 to Windows status still Open with 5 other changes artifact: 8066a866 user: chrstphrchvz
13:29 Ticket [1fb7af62]: 3 changes artifact: a5869e3e user: fvogel
Context
2019-07-24
13:31
(cherry-pick): Patch by Arjen sent to core 2018-09-21 Also, do some renumbering of mouse-buttons, such that at script level the XButtons appear to be at 4/5 while - internally - they are at 8/9. check-in: 93e45105 user: jan.nijtmans tags: bug-38dc27bd1d
2018-09-22
17:59
Patch by Arjen sent to core 2018-09-21 Leaf check-in: 77c390ba user: oehhar tags: tip474-uniform-mouse-wheel
2018-09-08
17:08
Fix [6fcaaa6f80]: ttk::entry insertion cursor not visible. Patch from Csaba Nemethi. check-in: 4c6cdfa4 user: fvogel tags: core-8-6-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tkEvent.c.

586
587
588
589
590
591
592
593











594

595
596
597
598
599
600
601
	    | Button4Mask | Button5Mask;

    switch (eventPtr->type) {
    case ButtonPress:
	dispPtr = TkGetDisplay(eventPtr->xbutton.display);
	dispPtr->mouseButtonWindow = eventPtr->xbutton.window;
	eventPtr->xbutton.state |= dispPtr->mouseButtonState;












	dispPtr->mouseButtonState |= GetButtonMask(eventPtr->xbutton.button);

	break;

    case ButtonRelease:
	dispPtr = TkGetDisplay(eventPtr->xbutton.display);
	dispPtr->mouseButtonWindow = None;
	dispPtr->mouseButtonState &= ~GetButtonMask(eventPtr->xbutton.button);
	eventPtr->xbutton.state |= dispPtr->mouseButtonState;






|
>
>
>
>
>
>
>
>
>
>
>
|
>







586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
	    | Button4Mask | Button5Mask;

    switch (eventPtr->type) {
    case ButtonPress:
	dispPtr = TkGetDisplay(eventPtr->xbutton.display);
	dispPtr->mouseButtonWindow = eventPtr->xbutton.window;
	eventPtr->xbutton.state |= dispPtr->mouseButtonState;
	
	if (eventPtr->xbutton.button == 4 || eventPtr->xbutton.button == 5) {
	    /*
	     * Turn the event into a mouse wheel event and queue it
	     * Note: modelled after the code in tkWinX.c
	     */
	    eventPtr->type = MouseWheelEvent;
	    eventPtr->xany.send_event = -1;
	    eventPtr->xkey.nbytes = 0;
	    eventPtr->xkey.keycode = eventPtr->xbutton.button == 4? -1 : 1;
	    Tk_QueueWindowEvent(eventPtr, TCL_QUEUE_TAIL);
	} else {
	    dispPtr->mouseButtonState |= GetButtonMask(eventPtr->xbutton.button);
	}
	break;

    case ButtonRelease:
	dispPtr = TkGetDisplay(eventPtr->xbutton.display);
	dispPtr->mouseButtonWindow = None;
	dispPtr->mouseButtonState &= ~GetButtonMask(eventPtr->xbutton.button);
	eventPtr->xbutton.state |= dispPtr->mouseButtonState;