Last active
November 18, 2019 14:23
-
-
Save typemytype/bb7d970cb5ec69e87c75fc2e5e0145f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from mojo.events import addObserver | |
| class SuperZoom(object): | |
| def __init__(self): | |
| addObserver(self, "keyDown", "keyDown") | |
| def keyDown(self, notification): | |
| view = notification["view"] | |
| event = notification["event"] | |
| characters = event.characters() | |
| factor = 5 | |
| if characters == "Z": # shift + z | |
| view.zoomIn(factor) | |
| elif characters == "X": # shift + x | |
| view.zoomOut(1 / factor) | |
| SuperZoom() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment