Community
    • Login

    Differentiate user pressing Backspace vs Find and Replace action

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    2 Posts 2 Posters 1.0k Views 1 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.
    • p0358P Offline
      p0358
      last edited by

      Hey, as in topic, is it possible? I currently detect backspace presses (deleting text) with SCN_MODIFIED and checking for flags SC_PERFORMED_USER & SC_MOD_DELETETEXT, but it appears the exact same notifications with exact same flags is dispatched when using Find and Replace function, which slows the replacement action down.
      My plugin is Code::Stats, it should add 1 XP on each character typed or deleted. Pasting or deleting multiple characters at once should also add just 1 XP, not the amount of characters changed. For adding characters, SCN_CHARADDED notification is the perfect solution. For removing I was using mentioned SCN_MODIFIED checking flags, is there a better solution?

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE Offline
        Ekopalypse @p0358
        last edited by

        @p0358

        maybe hooking npp and both scintilla message queues and see
        if you can find a pattern which could explain that this is/was a find/replace action?

        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