def onMouseWheel(self, event): if event.type in self.event.events: r = self.canvas.getBoundingClientRect() x = event.clientX - round(r.left) y = event.clientY - round(r.top) self.event._updateQueue(self.evt[event.type](event, x, y)) DOM.eventPreventDefault(event)
def onKeyDown(self, sender, keycode, mods): event = DOM.eventGetCurrentEvent() if event.key in self.modKey: self.event.keyPress[self.modKey[event.key]] = True if event.type in self.event.events: if not self._isPaused(event.key): self.event._updateQueue(self.evt[event.type](event)) DOM.eventPreventDefault(event)
def onKeyDown(self, sender, keycode, modifiers): if keycode in self.modKey: event = DOM.eventGetCurrentEvent() self.event.keyPress[keycode] = True self.event._updateQueue(event) DOM.eventPreventDefault(event) elif keycode in self.specialKey: event = DOM.eventGetCurrentEvent() self.event._updateQueue(event) DOM.eventPreventDefault(event)
def _onKeyDown(self, sender, keycode, mods): event = DOM.eventGetCurrentEvent() if keycode in self.modKeyCode: self.event.keyPress[keycode] = True if event.type in self.event.events: if not self._isPaused(keycode): self.event.keyCode = keycode if keycode in self.specialKeyCode: self.event._updateQueue(self.evt[event.type](event, keycode)) DOM.eventPreventDefault(event) else: DOM.eventPreventDefault(event)
def onKeyPress(self, sender, keycode, modifiers): event = DOM.eventGetCurrentEvent() if not (event.keyCode and event.keyCode in self.specialKey): self.event._updateQueue(event) DOM.eventPreventDefault(event)