def onKeyEvent( self, isDown, key, modifiers ): if not WorldEditor.cursorOverGraphicsWnd(): return 0 if key == KEY_RIGHTMOUSE: if ( not self.rightMouseButtonDown ) and isDown: self.rightMouseButtonDown = 1 self.mouseMoved = 0 elif self.rightMouseButtonDown and not isDown: self.rightMouseButtonDown = 0 if not self.mouseMoved: self.onRightMouse() handled = 0 if self.avatarMode and key == KEY_Q: self.qDown = isDown self.eDown = 0 handled = 1 if self.avatarMode and key == KEY_E: self.eDown = isDown self.qDown = 0 handled = 1 if not handled: handled = WorldEditor.camera().handleKeyEvent( isDown, key, modifiers ) if not handled and isDown: handled = self.ownKeyEvent( key, modifiers ) if not handled and WorldEditor.tool() != None: handled = WorldEditor.tool().handleKeyEvent( isDown, key, modifiers ) if not handled and isDown and key == KEY_LEFTMOUSE and self.objInfo.overGizmo: WorldEditor.gizmoClick() handled = 1 return handled
if pTemplateSection: deepCopyTemplate( pChunkSection, pTemplateSection ) group = WorldEditor.createChunk( pChunkSection, \ chunkName, \ self.mouseLocator.subLocator ) if ( group != None ): self.chunkItemAdded( self.objInfo.getBrowsePath() ); except Exception, e: WorldEditor.addCommentaryMsg( e.args[0], 1 ) # key event entry point def onKeyEvent( self, (isDown, key, modifiers), tool ): if not WorldEditor.cursorOverGraphicsWnd(): return 0 handled = 0 if not isDown and key == KEY_LEFTMOUSE: self.dragging = 0 if isDown: if key == KEY_LEFTMOUSE: self.leftMouseDown = 1 self.onLeftMouse() handled = 1 if key == KEY_MIDDLEMOUSE: self.onMiddleMouse() handled = 1 #elif key == KEY_RETURN: