0

I'm currently trying to write an Image Viewer, but the "Forward/Backward" Buttons on the mouse are not triggering any of the possible binds in tkinter.

I tried the binds:

<Key>, <KeyPress>, <ButtonPress>, <Return>

but none of them can detect the mouse clicks on the forward/backward button.

Has Python even the possiblity to detect them?

Edit:

The buttons are called XButtons and are hookable with PyHook or PyQt, but if I try to let them run in the background, they are lagging massively, any way to prevent that?

I'm currently trying to let this script run smoothly in the background without causing extreme lags

Edit:

Using wxPython with PyHook solved my problem, since Tkinter and PyHook is causing huge lags, which don't appear with wxPython

Community
  • 1
  • 1
Hubert
  • 21
  • 5
  • 1
    [Tkinter: bind additional mouse buttons](http://stackoverflow.com/questions/22237848/tkinter-bind-additional-mouse-buttons) – Lafexlos Nov 07 '15 at 11:04
  • found this already and was the reason why I mentioned the binds in the post, but it would suffice to trigger a callback with any lib out there, I'm not sure how it exactly works, but the forward button should at least send any signal to the frame – Hubert Nov 07 '15 at 18:00

1 Answers1

0

The answer may vary by platform, and also by mouse driver.

On my OSX device where I have a logitech mouse with a total of five buttons, the fourth and fifth buttons are considered buttons 4 and 5. For example, I can bind to <Button-4> and <Button-5>.

That might work for you, or your mouse driver might assign those buttons to something else.

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
  • if it was the 4 and 5 key, it would've triggered by the – Hubert Nov 07 '15 at 17:34