Hello, I’ve this program (which prints the number of clicks inside the window):
import direct.directbase.DirectStart
from direct.gui.OnscreenText import OnscreenText
t, n = OnscreenText(), 0
def printClick(): global n; t.setText( str( n ) ); n += 1
base.accept( 'mouse1', printClick )
run()
I’m on Maverik Meerkat, Panda 1.7.2. If I launch it and lose the focus of the window with mouse clicks (as instance, if I click on the window of another application, or change the current desktop using the mouse) then, when I click again in the window, it works.
But, if I do the same operations using shortcuts (ALT-TAB to change the application, CTRL-ALT-arrows to change the desktop) then the following clicks in the window are not catched.
Does it happen only on my machine? Am I doing anything wrong? Thank you!