Community
    • Login

    Call Shortcuts in Plugin Code

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 473 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Benjamin GrimmB Offline
      Benjamin Grimm
      last edited by

      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.

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP Offline
        PeterJones @Benjamin Grimm
        last edited by

        @benjamin-grimm ,

        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.

        Benjamin GrimmB 1 Reply Last reply Reply Quote 1
        • Benjamin GrimmB Offline
          Benjamin Grimm @PeterJones
          last edited by

          @peterjones Thank you. I’ll check it out right now.

          1 Reply Last reply Reply Quote 0

          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
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors