• Login
Community
  • Login

Differentiate user pressing Backspace vs Find and Replace action

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
2 Posts 2 Posters 714 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.
  • P
    p0358
    last edited by May 19, 2019, 1:20 AM

    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?

    E 1 Reply Last reply May 19, 2019, 11:31 AM Reply Quote 0
    • E
      Ekopalypse @p0358
      last edited by May 19, 2019, 11:31 AM

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