GTK+ 4: knowing the action/event at the origin of a text insertion/deletion?



Hi,

With the plans for GTK+ 4, I wonder if it'll solve the following
use-case.

Knowing where does a text insertion/deletion come from. In GtkTextView
and GtkEntry. Is it a key press? Is it a cut/paste/…? Is it done
programmatically? Etc.

Because currently with GTK+ 3 there are heuristics in GtkSourceView (for
the undo/redo) and gspell (to not underline the word currently typed) to
know whether a text insertion/deletion is a simple key press. If the
inserted/deleted text is only one character at the cursor position, it
assumes that it was a key press.

For example in GtkSourceView for the undo/redo:
https://git.gnome.org/browse/gtksourceview/tree/gtksourceview/gtksourceundomanagerdefault.c?h=3.24.3#n42

But heuristics are not ideal of course. Will the input handling rework
in GTK+ 4 support that use-case?

Thanks,
Sébastien


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]