python tkinter: detecting horizontal scrolling on touchpad
问题 i have a (large) python tkinter canvas. Navigation with arrow keys and (shift-)mousewheel is straight forward. But I would like to do it aswell via two fingers on the tochpad of a laptop. Today I found this to recognize horizontal scrolling (Ubuntu 16.04 LTS, Python 2.x): from Tkinter import * class MyAnything(): def __init__(self): self.root = Tk() self.root.bind('<Button>', self.on_pressed_button) self.root.mainloop() def on_pressed_button(self, event): print(event.num) if __name__ == '_