schriftgestalt / GlyphsSDK

Scripting SDK for Glyphs
Apache License 2.0
89 stars 37 forks source link

Hotkey customisation support in SelectTool #57

Open takaakifuji opened 3 years ago

takaakifuji commented 3 years ago

Both G3 and G2 support hotkey customisation for the builtin .glyphsTool plugins via the user defaults:

$ defaults write com.GeorgSeifert.Glyphs3 AnnotationTool.Hotkey 'q'

I think it's nice to have it supported also in the Python wrapper by default.

def trigger(self):
    return Glyphs.defaults['.'.join((type(self).__name__.replace('NSKVONotifying_', ''), 'Hotkey'))] or self.keyboardShortcut

Replacing the trigger() method in plugins.py like above will do.