When we work with Entries and Textviews in GTK, it's possible for the user to add emojis in the text content, by just clicking with the mouse right button on the widget, then clicking on "Insert Emoji". My question is: how to remove emoji insertions in Entries and Textviews in GTK? I am using Gtk 3 C programming in a GNOME desktop, but other languages might have similar solution.
See an image about the issue:
CodePudding user response:
You can remove the option with gtk_text_view_set_input_hints (view, GTK_INPUT_HINT_NO_EMOJI)
for GtkTextView
and gtk_entry_set_input_hints (entry, GTK_INPUT_HINT_NO_EMOJI)
for GtkEntry
If you don't want to modify existing input hints, you can do gtk_entry_set_input_hints (entry, gtk_entry_get_input_hints (entry) | GTK_INPUT_HINT_NO_EMOJI)
in GTK4, gtk_text_set_input_hints()
can also be used where it's applicable