I have a Python Tkinter Text widget with scrollbars. I would like to define my own method for using horizontal edge scrolling on my laptop\'s touchpad. However, I don\'t kno
I just wanted to add on that on MacOS as no where tells this and I spent quite a bit of time experimenting and searching. The event.state changes from 0 for vertical mouse scroll and 1 for horizontal mouse scroll.
def mouseScroll(event):
if event.state == 0:
canvas.y_viewscroll(-event.delta, "units")
elif event.state == 1: # you can use just an else as it can only be 0 or 1
canvas.x_viewscroll(-event.delta, "units")