Dec-28-2020, 10:00 PM
Ok, I entirely commented out the on_press function and it seems to work fine.
Also I added some code to on_touch_scroll. Pushing the buttons now does not make the screen jump! But I cannot slowly scroll the screen, only can scroll with fast finger flicks now.
I guess I can live with that compromise (lost the ability to slow scroll). But there is another issue that persists - if my last touch was far from the newest touch, the screen will scroll a tiny amount towards the new touch. I would definitely like to know how to deactivate that effect.
Also I added some code to on_touch_scroll. Pushing the buttons now does not make the screen jump! But I cannot slowly scroll the screen, only can scroll with fast finger flicks now.
I guess I can live with that compromise (lost the ability to slow scroll). But there is another issue that persists - if my last touch was far from the newest touch, the screen will scroll a tiny amount towards the new touch. I would definitely like to know how to deactivate that effect.
def on_touch_scroll(event): nowy = event.y_root sectionmoved = 11 # speed of scroll if nowy > (self.prevy + 20): # to limit the minimum threshold to scroll event.delta = -sectionmoved elif nowy < (self.prevy - 20): # to limit the minimum threshold to scroll event.delta = sectionmoved else: event.delta = 0 self.prevy= nowy self.scrollposition += event.delta canvas.yview_moveto(self.scrollposition/ self.canvasheight)