[scintilla:bugs] #2484 SCN_MODIFIED: distinguishing between typing and pasting

0 views
Skip to first unread message

DV

unread,
Jul 11, 2025, 8:22:30 AMJul 11
to scintill...@googlegroups.com

[bugs:#2484] SCN_MODIFIED: distinguishing between typing and pasting

Status: open
Group: Feature_Request
Created: Fri Jul 11, 2025 12:22 PM UTC by DV
Last Updated: Fri Jul 11, 2025 12:22 PM UTC
Owner: nobody

I'm interested in the SC_MOD_INSERTCHECK, SC_MOD_INSERTTEXT and SC_MOD_DELETETEXT notifications types of SCN_MODIFIED.
These notifications may happen when:
- either a character has been typed on the keyboard (or, in case of SC_MOD_DELETETEXT, the Delete or BackSpace button has been pressed);
- or a text has been pasted from the clipboard.

I'd like to be able to distinguish these two cases.
For example, in case of SC_MOD_INSERTCHECK or SC_MOD_INSERTTEXT, I want to provide one kind of reaction to a character pressed by user (a "typing flow") and to provide another kind of reaction to text pasted from the clipboard (a "pasting flow"). How can I achieve that?


Sent from sourceforge.net because scintill...@googlegroups.com is subscribed to https://sourceforge.net/p/scintilla/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/scintilla/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.

Neil Hodgson

unread,
Sep 26, 2025, 7:33:46 PMSep 26
to scintill...@googlegroups.com

With typed characters, there is a SCN_CHARADDED notification after the SCN_MODIFIED.

It would be reasonable to add another field or re-use characterSource to distinguish cases but it would require work at many call sites. There are around 35 direct calls to inserting text and some of these are from multiple causes. An implementation would need to define a reasonable enumeration - which cases are distinct and which are equivalent.

Reply all
Reply to author
Forward
0 new messages