Why is event.clientX incorrectly showing as 0 in firefox for dragend event?

This is officially an issue with Firefox — Bugzilla: Bug #505521, Set screen coordinates during HTML5 drag event. I’ll quote jbmj to summarize, and I will bold the original developer they are quoting… I can’t believe that this comment “Note though that it doesn’t specify what the properties should be set to, just that they … Read more

Mouse Position Python Tkinter

You could set up a callback to react to <Motion> events: import Tkinter as tk root = tk.Tk() def motion(event): x, y = event.x, event.y print(‘{}, {}’.format(x, y)) root.bind(‘<Motion>’, motion) root.mainloop() I’m not sure what kind of variable you want. Above, I set local variables x and y to the mouse coordinates. If you make … Read more

What is the difference between screenX/Y, clientX/Y and pageX/Y?

Here’s a picture explaining the difference between pageY and clientY. Same for pageX and clientX, respectively. pageX/Y coordinates are relative to the top left corner of the whole rendered page (including parts hidden by scrolling), while clientX/Y coordinates are relative to the top left corner of the visible part of the page, “seen” through browser … Read more