예제 #1
0
파일: display.py 프로젝트: jggatc/pyjsdl
 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)
예제 #2
0
파일: display.py 프로젝트: jggatc/pyjsdl
 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)
예제 #3
0
 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)
예제 #4
0
 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)
예제 #5
0
파일: display.py 프로젝트: jggatc/pyjsdl
 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)
예제 #6
0
 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)
예제 #7
0
 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)