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

Add Shortcut Keys to navigate/modify molecules #1794

Closed
Milziade opened this issue Nov 18, 2024 · 7 comments · Fixed by #1807
Closed

Add Shortcut Keys to navigate/modify molecules #1794

Milziade opened this issue Nov 18, 2024 · 7 comments · Fixed by #1807

Comments

@Milziade
Copy link
Contributor

It would be very useful to have shortcut keys to move faster between molecule editing tools (navigation, draw, selection, measure, ...)
By now I have to click on tool's button to change tool, but it would save a lot of time to have some shortcut (e.g. Alt + 1 for Navigation tool, Alt + 2 for Draw and so on)
The best would be to add Preference submenu (maybe under File menu?) where you can configure your own shortcut, but I think a good start would be to add these shortcut

Thank you for taking in consideration such suggestion!

Copy link

welcome bot commented Nov 18, 2024

Thanks for opening your first issue here! Please try to include example files and screenshots if possible. If you're looking for support, please post on our forum: https://discuss.avogadro.cc/

@ghutchis
Copy link
Member

It already exists. Control + 1, Control + 2, etc.

@Milziade
Copy link
Contributor Author

Oh I see... Thank you!
I think it would be useful to add these shortcut in the button description, it would be easier for novice (like me) to find out.
I'll try to change the description and submit a pull request if it works

P.s. Reading the Navigator.ccp file, I found that you can use WASD / arrow keys / ... for a more precise rotation, maybe a pop-up with Tips & Tricks containing such info would be useful (similar to the LibreOffice ones)

@matterhorn103
Copy link
Contributor

I think it would be useful to add these shortcut in the button description, it would be easier for novice (like me) to find out.
I'll try to change the description and submit a pull request if it works

Yes, definitely, this is something I've been meaning to add ever since I myself learnt about the shortcuts. The tooltips need a little bit of work anyway but it would be really great if you could add the shortcuts to the tooltips!

P.s. Reading the Navigator.ccp file, I found that you can use WASD / arrow keys / ... for a more precise rotation, maybe a pop-up with Tips & Tricks containing such info would be useful (similar to the LibreOffice ones)

That also reminds me to add that to the documentation for the Navigation Tool, thanks.

@Milziade
Copy link
Contributor Author

Hi! I just created pull request with these small changes.
Feel free to tell me if anything is wrong

Thank you for your time

@ghutchis
Copy link
Member

ghutchis commented Nov 21, 2024

Thanks. I appreciate the pull request, but I think it's probably better to do it via %1, e.g.

"Draw Tool \t(%1)\n\n"

First of all, if we change the order (e.g., the Auto-Optimize tool will appear) we can re-assign the shortcuts via code.

Secondly, on a Mac, it's not the "Ctrl" key, it's the "Command" key. (And both probably need to be translated / localized).

So the code would look something like this:

QString shortcut = tr("Ctrl+2", "control-key 2");
tr("Draw Tool \t(%1)\n\n"
       "Left Mouse: \tClick and Drag to create Atoms and Bond\n"
       "Right Mouse: \tDelete Atom").arg(shortcut));

@Milziade
Copy link
Contributor Author

Fixed as requested. I tested it on Linux machine with Ctrl key, if anyone can test it on Mac would be great

ghutchis added a commit that referenced this issue Nov 26, 2024
Add Shortcut Keys to navigate/modify molecules (Issue #1794)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants