Call Shortcuts in Plugin Code
-
Dear All
I try to create a Plugin which should make some of my tasks easier. One of the tasks requires 6 different shortcuts after each other. Now I wanted to ask if someone knows a way to call the preconfigured shortcuts from the Shortcut Mapper. If it’s not possible, does anyone know where in the source code of N++ the definitions of the shortcuts are, so I can use the code as an inspiration.
Thanks. -
I know that if you put your commands in your plugin’s top-level menu, that you can use the shortcut mapper to assign the shortcut. (So Plugins > My Nifty Plugin > My Command will be visible on the Shortcut Mapper’s Plugins tab, but Plugins > My Nifty Plugin > My SubMenu > My Deep Command will not be visible to Shortcut Mapper.)
I am not a plugin developer, so I don’t know how to assign a default shortcut. But I know that many plugins do come with default shortcuts for their menu items, so looking at the source code for another plugin might tell you.
Okay, I knew that the TagLEET plugin that @michael-vincent modified/adapted had some default keystrokes when you install it… so I searched his codebase for “shortcut” and found this code which appears to be where it is set up (where the order of the array shown is defined here). Maybe you can use that as an example.
-
@peterjones Thank you. I’ll check it out right now.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login