Ubuntu – Accessibility Tweak: How to prevent accidentally selected text from getting replaced when typing

accessibilitylibreofficemousethunderbird

I'm trying to make my 97 years old grandma's laptop (Ubuntu 20.04) more accessible for her. She is often frustrated because text that she has written vanishes. Disabling the touchpad and using an external mouse already helped a lot. But I suspect that she still accidentally selects text, when she tries to place the text cursor with her mouse (by dragging or double-clicking). When she continues typing the selected text is being overwritten. Because she needs to focus on the keyboard while typing she won't notice immediately what happened, making it difficult to "Undo".

  1. Would it be possible to disable this behavior so that selected text would be deselected instead of replaced, when typing?
  2. Is this a feature provided by the Linux system or is it implemented in each program? (Programs of interest are LibreOffice Writer and Mozilla Thunderbird)
  3. If changing the behavior is not possible, can I disable text selection via mouse in general?

Edit:

As suggested by @user-dz I created separate questions on how to address this issue in LibreOffice Writer and Thunderbird.
This question remains focused on how to solve this system-wide in Ubuntu 20.04.

Best Answer

The selected text is copied to PRIMARY selection buffer. You could monitor it and send Right arrow key if it changes, to move to the end of the selected text. This works with any application, not only LibreOffice/Thunderbird, at least on X11+GNOME.

# Install dependencies
sudo apt install xdotool  git build-essential libx11-dev libxtst-dev

# Compile clipnotify
git clone https://github.com/cdown/clipnotify.git
cd clipnotify
make

# Run the monitor, could be on ~/.xprofile, or under ~/.config/autostart/
while ./clipnotify;do xdotool key Right; done

# Optional: To kill the monitor on any other Terminal
killall clipnotify

Probably are better ways to do this, maybe using Dbus.

Inspiration and useful links: