Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't set the keyboard shortcut for the SelectTool Plugin #48

Open
mumchristmas opened this issue Apr 1, 2021 · 6 comments
Open

Can't set the keyboard shortcut for the SelectTool Plugin #48

mumchristmas opened this issue Apr 1, 2021 · 6 comments

Comments

@mumchristmas
Copy link

Glyphs Version: 3.0.3 (3075)

Codes in def settings(self):

self.keyboardShortcut = 'g'

or

Defaults = NSUserDefaults.standardUserDefaults()
Defaults.registerDefaults_({"Pixel45.hotKey" : "g"})
self.keyboardShortcut = Glyphs.defaults["Pixel45.hotKey"]

Not working right now.

WX20210402-000224@2x
And the tool will get a hotkey 'V' from some where. Also not working.

@schriftgestalt
Copy link
Owner

What happens when you implement a trigger() method and return the hot key?

@mumchristmas
Copy link
Author

What happens when you implement a trigger() method and return the hot key?

Sorry, I don't quite get your words. The print(self.trigger()) always return a ‘g’ here.

@schriftgestalt
Copy link
Owner

In your plugin implementation, add this:

def trigger(self):
    return "g"

@mumchristmas
Copy link
Author

mumchristmas commented Apr 2, 2021

In your plugin implementation, add this:

def trigger(self):
    return "g"

I tried this already. Still not working.

@schriftgestalt
Copy link
Owner

Can you send me your plugin?

@mumchristmas
Copy link
Author

mumchristmas commented Apr 2, 2021

Can you send me your plugin?

Okay, plz check the support inbox.

update:
Ha, I removed the @objc part before my code. then the def trigger(self): way is working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants