[PD] Getting pointer coords in patcher windows

Derek Kwan derek.x.kwan at gmail.com
Fri Dec 9 06:24:49 CET 2016


Hello,

Apologies in advance, bit new to Tcl/Tk, but I'm trying to get the
pointer coordinates of the mouse for an external (yes, Cyclone) via Tcl
for both the currently active patcher window and the window in which the
external object class was instantiated. The latter sounds trickier and I
haven't got there yet, but for the former I'm trying [winfo pointerx
$::focused_window] and it seems to just be spitting out screen coords.
I've tested out [winfo rootx $::focused_window] and that seems to be
sptting the proper top-left coords of the focused window so what am I
doing wrong? I suppose if nothing else works, I can just subtract the
rootx/y values from the screen values I'm getting and clip them to the
window's dimensions. If it helps, I'm testing in Ubuntu. Thanks in
advance!

Derek

-- 
Derek Kwan
www.derekxkwan.com



More information about the Pd-list mailing list