Tk Source Code

View Ticket
Login
Ticket UUID: 82aadad30fb7e2fe06575dec7aae6f38ba189935
Title: Trackpad scrolling in doesn't work on some laptops
Type: Bug Version: 8.6.3
Submitter: anonymous Created on: 2014-12-10 13:26:36
Subsystem: 68. Win Window Operations Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2020-03-23 07:48:28
Resolution: None Closed By: nobody
    Closed on:
Description:
Following program allows trackpad scrolling on MacBook Pro but not on Lenovo T420+Windows 7. Mouse wheel scrolling works on both. It doesn't look like some kind of (obvious) drivers' problem, because non-Tk programs' trackpad scrolling works on both laptops.

-------------
package require Tk
toplevel .tl
text .tl.t -yscrollcommand {.tl.s set}
scrollbar .tl.s -command {.tl.t yview}
grid .tl.t .tl.s -sticky nsew
grid columnconfigure .tl 0 -weight 1
grid rowconfigure .tl 0 -weight 1


for { set i 0 } { $i < 1000 } { incr i } {
    .tl.t insert end "Row $i" "" "\n" ""
}
------------- 

I tried similar tkinter program also on some other Windows laptops (HP and Dell), and trackpad scrolling works on these. So the problem is apparent on Lenovo+Windows and also on Lenovo+Windows+Vmware+Ubuntu.
User Comments: oehhar added on 2020-03-23 07:48:28:

There was another fix around 8.6.8 to support high-resolution mouse-pads.

Before that patch, a scrolling width was required to reach 120 (which is one click on a physical scrollwheel). Hoigh-Res Scrollpads gave higher resolution. Unfortunately, the events were ignored, as the X did not reach 120.

Sorry, out of my brain.

I propose to close the bug.


chrstphrchvz added on 2020-03-21 17:43:31:

The MouseWheel scroll bindings have been tweaked in recent 8.6 releases, is the issue still present?

If so, it would be useful to see what kinds of events Tk is getting, if any. Something like:

package require Tk

pack [label .l -width 20 -height 8 -text {Scroll here!}]

bind .l <KeyPress> {puts {key press %K}} bind .l <ButtonPress> {puts {button press %b}} bind .l <MouseWheel> {puts {vertical scroll %D}} # In Tk 8.6.10 for Windows, horizontal scrolling # emulates shift+vertical scrolling bind .l <Shift-MouseWheel> {puts {horizontal scroll %D}}

The expected result is that trackpad scrolling produces <MouseWheel>/<Shift-MouseWheel> events.


dkf added on 2016-08-22 08:36:17:

I'm guessing it is a problem in mapping the events from the Windows side into events understood by Tk.