OS: openSUSE Leap 42.1
I'm using Tkinter in python2.7. When I want to get the coordinates of cursor by accessing "event.x_root" and "event.y_root", the values of them are always 0, which means that the cursor is at the top left corner. This happened when using key-press event, but I can get correct value when using mouse button clicking event event.
So I wonder why the values of x_root and y_root are always 0 when using key-press event but they are correct values when using mouse button clicking event.
What's more, I found that the code worked correctly on Windows 8.
The code is as folows:
from Tkinter import *
def onKeyboardEvent(event):
print event.x_root, event.y_root
return True
root = Tk()
root.resizable(False, False)
root.title("colorPicker")
root.bind("<Key>", onKeyboardEvent)
root.mainloop()