Skip to content

Instantly share code, notes, and snippets.

@okay-type
Last active May 9, 2021 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okay-type/dbdbcd65282f0dfe04aa86f861103606 to your computer and use it in GitHub Desktop.
Save okay-type/dbdbcd65282f0dfe04aa86f861103606 to your computer and use it in GitHub Desktop.
rf4 version
from mojo.subscriber import Subscriber, registerGlyphEditorSubscriber
class SimpleSubscriberTest(Subscriber):
debug = False
def build(self):
if self.debug == True:
print('SimpleSubscriberTest', 'SimpleSubscriberTestbuild!')
def destroy(self):
if self.debug == True:
print('SimpleSubscriberTest', 'destroy!')
def glyphEditorDidKeyDown(self, info):
print('keyWasPressed')
event = info['lowLevelEvents'][0]['event']
print(event)
characters = event.characters()
print(characters)
registerGlyphEditorSubscriber(SimpleSubscriberTest)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment