ive also tried no directObject inheritance, base.accept, and self.win1.accept where win1 is the window i want. Ive also tried checking if the current window has the pointer and keyboard with
if self.win1.hasKeyboard(0):
self.accept("mouse1", self.makePlatform)
print(':D')
else:
print('D:')
and i get a printed but the event doesnt seem to be sent?
Hmm… Have you added any printouts to that method to check whether the control reaches it? Have you tried adding “base.disableMouse()” to your init method, at some point before accepting “mouse1”, in order to disable the default mouse controls?
Disabling default mouse controls could be helpful and ill try that when i get home, but that doesnt explain why i cant seem to get keyboard input working in a second window. Thanks for the reply!
no go with disabling the mouse - its something with the accept statement. clicking doesnt seem to be generating the “mouse1” event its like its called something else.
You need to create a MouseWatcher for the new window. This is what base.setupMouse() does. There are several threads in the forum that discuss this, see:
DirectGui is a whole other ball of wax. If you want DirectGui objects to work in the second window, you also need to create a PGTop node to be at the root of the 2-d scene graph for the second window, and point this PGTop to your new window’s MouseWatcher.
That makes sense, thanks for the reply, ill see what i can do after browsing thru the directGui code by setting up directgui in the new window will I have to remove it from the main window so it doesn’t react to keypresses while im typing in the new window?
thanks so i need to create a render2d node than a PGtop node thats attached to that and i pass that to the mousewatcher? sorry im unfortunately new to digging around in panda’s source