Community
    • Login

    Call Shortcuts in Plugin Code

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 223 Views
    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
      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
        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
          Benjamin Grimm @PeterJones
          last edited by

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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors