本文整理汇总了Python中PyGUIBase.PyGUIBase.handleMouseButtonEvent方法的典型用法代码示例。如果您正苦于以下问题:Python PyGUIBase.handleMouseButtonEvent方法的具体用法?Python PyGUIBase.handleMouseButtonEvent怎么用?Python PyGUIBase.handleMouseButtonEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyGUIBase.PyGUIBase
的用法示例。
在下文中一共展示了PyGUIBase.handleMouseButtonEvent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handleMouseButtonEvent
# 需要导入模块: from PyGUIBase import PyGUIBase [as 别名]
# 或者: from PyGUIBase.PyGUIBase import handleMouseButtonEvent [as 别名]
def handleMouseButtonEvent(self, comp, event):
PyGUIBase.handleMouseButtonEvent(self, comp, event)
if event.key == Keys.KEY_LEFTMOUSE:
if event.isKeyDown() and not self.buttonPressed:
self.buttonPressed = True
elif not event.isKeyDown() and self.buttonPressed:
self.buttonPressed = False
self._onClick()
self._updateVisualState()
return True
示例2: handleMouseButtonEvent
# 需要导入模块: from PyGUIBase import PyGUIBase [as 别名]
# 或者: from PyGUIBase.PyGUIBase import handleMouseButtonEvent [as 别名]
def handleMouseButtonEvent(self, comp, event):
PyGUIBase.handleMouseButtonEvent(self, comp, event)
slider = self.component.parent.script
if event.key == Keys.KEY_LEFTMOUSE:
if event.isKeyDown() and not slider.thumbPressed:
slider.thumbPressed = True
elif not event.isKeyDown() and slider.thumbPressed:
slider.thumbPressed = False
slider._updateVisualState(hover=True)
return DraggableComponent.handleMouseButtonEvent(self, comp, event)
示例3: handleMouseButtonEvent
# 需要导入模块: from PyGUIBase import PyGUIBase [as 别名]
# 或者: from PyGUIBase.PyGUIBase import handleMouseButtonEvent [as 别名]
def handleMouseButtonEvent(self, comp, event):
PyGUIBase.handleMouseButtonEvent(self, comp, event)
pos = self._getWebCoordinates(event.cursorPosition)
if pos is None:
return False
else:
if event.isKeyDown():
setFocusedComponent(self.component)
self.webPage.handleMouseButtonEvent(pos, event.isKeyDown())
return True