Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Implement global shortcuts #392

Open
benebsiny opened this issue Jun 14, 2023 · 3 comments
Open

Implement global shortcuts #392

benebsiny opened this issue Jun 14, 2023 · 3 comments

Comments

@benebsiny
Copy link
Contributor

Ctrl+Shift+I opens devtools by default in Electron. However, we must put w.OpenDevTools() to open the devtool in go-astilectron. Is it possible to make that combination key to open the devtools?

@asticode
Copy link
Owner

You can add shortcuts using accelerators in your menu items.

However, in your case, you can also add a menu item having its role set to toggledevtools. This should add the proper shortcut automatically.

@benebsiny
Copy link
Contributor Author

benebsiny commented Jun 14, 2023

It works, thanks!

This method seems unintuitive. Also, there's a menu bar on top (I don't need it). It would be great if this feature is wrapped as globalShortcut-like object.

@asticode
Copy link
Owner

It seems like a good idea, I'll rename this issue and keep it open.

Feel free to submit a PR if you feel like implementing it 👍

@asticode asticode changed the title Shortcut of DevTools by default Implement global shortcuts Jun 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants