Shortcut (hot key) will be supported...

Don HO
  • Don HO

    Don HO - 2005-10-28

    In the next release the plugin shortcut (hot key) is supported.

    Unfortunatly, all the plugins work for n++ v3.2 or before won't be compatible with v3.3, so you have to add the following code then recompile your plugin.
    in PluginInterface.h :

    //-- Begin added code
    struct ShortcutKey {
        bool _isCtrl;
        bool _isAlt;
        bool _isShift;
        unsigned char _key;
    //-- End added code

    typedef struct {
        char _itemName[itemNameMaxLen];
        PFUNCPLUGINCMD _pFunc;
        int _cmdID;
        bool _init2Check;
            //-- Begin added code
        ShortcutKey *_pShKey;
            //-- End added code
    } FuncItem;

    and in your code you should initialize _pShKey as NULL if you don't need the shortcut. Otherwise just allocate a ShortcutKey object with alloc or new, fill out the shortcut you want then assign the pointer to _pShKey.

    The updated plugin demo (source) is available here :

    You will need also the new version of Notepad++ to test the shortcuts :

    Note that the plugin shortcut feature is not quite complete. I'll continue working on it.


    • f0dder

      f0dder - 2005-10-29

      Thanks a bunch - looking forward to next release!

    • Don HO

      Don HO - 2005-11-05

      Here's a question about shortcut from Jens :

      > How do you handle the shortcuts? I mean, everbody could define his own  shortcut
      > and so it is possible, that some developer has exactly the same!

      In this case, the plugin which is loaded firstly gets the shortcut control.
      It means that the author of plugin should give the possibility to end user to modify the shortcut,
      in order to avoid the shortcut conflict among the plugins.



Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks