|
|
|
|
|
|
|
|
lastTick = k[1] |
|
|
lastTick = k[1] |
|
|
_DOWNKEYS.remove(k) |
|
|
_DOWNKEYS.remove(k) |
|
|
if tick - lastTick <= _ClickDelayMax: |
|
|
if tick - lastTick <= _ClickDelayMax: |
|
|
Events.emit("KEYPRESSED", {"key":key, "mod":pygame.key.get_mods()}) |
|
|
|
|
|
|
|
|
Events.emit("KEYPRESSED", {"key":key, "mod":pygame.key.get_mods(), "key_name":pygame.key.name(key)}) |
|
|
return # Done. |
|
|
return # Done. |
|
|
# We found nothing, boss. |
|
|
# We found nothing, boss. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Events.emit("QUIT", {}) |
|
|
Events.emit("QUIT", {}) |
|
|
elif event.type == pygame.KEYDOWN: |
|
|
elif event.type == pygame.KEYDOWN: |
|
|
_WatchKey(event.key) |
|
|
_WatchKey(event.key) |
|
|
Events.emit("KEYDOWN", {"unicode":event.unicode, "key":event.key, "mod":event.mod}) |
|
|
|
|
|
|
|
|
Events.emit("KEYDOWN", {"unicode":event.unicode, "key":event.key, "mod":event.mod, "key_name":pygame.key.name(event.key)}) |
|
|
elif event.type == pygame.KEYUP: |
|
|
elif event.type == pygame.KEYUP: |
|
|
Events.emit("KEYUP", {"key":event.key, "mod":event.mod}) |
|
|
|
|
|
|
|
|
Events.emit("KEYUP", {"key":event.key, "mod":event.mod, "key_name":pygame.key.name(event.key)}) |
|
|
_ReleaseKey(event.key) |
|
|
_ReleaseKey(event.key) |
|
|
elif event.type == pygame.MOUSEMOTION: |
|
|
elif event.type == pygame.MOUSEMOTION: |
|
|
Events.emit("MOUSEMOTION", {"pos":event.pos, "rel":event.rel, "buttons":event.buttons}) |
|
|
Events.emit("MOUSEMOTION", {"pos":event.pos, "rel":event.rel, "buttons":event.buttons}) |