8

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.

9
  • 1
    The auto-select in the browser location bar is the most annoying thing in the world... I often want to fix one character and end up deleting the whole thing because it auto-selected. Argh! But to semi-answer your question, I'm afraid I've never seen such a possibility (not replace the selected text) anywhere. Nov 5, 2020 at 5:03
  • 1
    You might investigate different options for mouse hardware -- you can even change the microswitches for ones that need more force (but seeking out mice that need more force might be easier). You might want to look at scripting the mouse so that when ever there is a button release you add an extra click (which would reset the selection but make drag-selection impossible). Xdotool (man page) or similar should do this.
    – pbhj
    Nov 5, 2020 at 19:07
  • 1
    Maybe you want to have look at this addons.mozilla.org/de/firefox/addon/disable-selection Could be extensions for Thunderbird work somewhat similar. Didn't test tbh.
    – neun24
    Nov 6, 2020 at 2:07
  • 1
    @AlexisWilke Yeah! Sometimes there exist hidden keys in TB or FF in about:config but I didn't find anything useful in this matter
    – Anton S.
    Nov 6, 2020 at 16:30
  • 1
    @pbhj That's a promising lead. Although I guess I'm experiencing this bug in xdotool which prevents me from registering anything to the mouse-click event: xdotool search . behave %@ mouse-click getmouselocation
    – Anton S.
    Nov 6, 2020 at 17:18

2 Answers 2

2
+100

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:

3
  • That's interesting, xsel can be even used to clear the selection. I expect this works only for Xorg (not Wayland), right?
    – user.dz
    Nov 11, 2020 at 19:48
  • 1
    @user.dz Wayland and GNOME implements primary selection, but clipnotify is based on XFIXES extension of X11. I couldn't find a more elegant way to monitor. Nov 11, 2020 at 20:07
  • I tested it in 20.10. xsel didn't work (LibreOffice should have it's own buffer), Not big deal. Otherwise sending Right key works with minor effect in Terminal when it send such key intentionally. Anyway, it could be avoided by watching for active window using wmctrl so no action on some apps like terminal emulators. (Joke: Sure at that time it will be him (OP) helping his grandma, who else gonna open the terminal)
    – user.dz
    Nov 12, 2020 at 13:57
1

Partial answer

  • (2) LiberOffice, Thunderbird and Firefox, each has its own implementation of text edit box.

    But there many tool that are build on top of a GUI kit like GTK, Qt, wxWidgets,.. So you may expect Gnome tools to be GTK based and KDE tools to be based on Qt. So change may be required at their level.

  • (3) With LibreOffice, I have only found this feature that may help:

    • Change the "selection mode" at the bottom status bar to "Block selection". Still can select with mouse but not double click.
  • (3) For Mouse Accessibility, I don't remember any action that require double-click (Only CAD, Games, IDE). Usually, tools have other way using keyboard shortcut or menu entry.

    • Disable double-click, Settings → Accessibility → Double-click Delay: Shortest (minimum).
  • (3) Mouse Settings, The previous step does not fix selection by Drag. A trick that may work is killing short moves by lowering pointer speed and raising its acceleration to compensate for long moves.

    • Settings → Mouse & Touchpad → Mouse Speed: Lower

    • Mouse Acceleration: Higher using

      xset [mouse [accel_mult[/accel_div] [threshold]]] [mouse default]
      

      (Permanent setting, should be a way using libinput or X)

  • (3) Minimize use of mouse for short moves (It may be hard to adapt)

    • Use of keyboard to move
    • Activate keyboard mouse keys, Settings → Accessibility → Mouse Keys
    • Change to TrackBall mouse
2
  • 1
    Thanks for your answer! Disabling double click selection in LibreOffice is a start! Let's see if there are further ideas. Digging in the source-code to produce my own custom LibreOffice or Thunderbird builds is currently no option for me. And I didn't find out yet if it would be possible to alter the mouse selection behavior via a simple Thunderbird-/LibreOffice- Extension.
    – Anton S.
    Nov 2, 2020 at 12:45
  • 1
    Even though you're answer is only a partial answer it contains many useful ideas on how to make the mouse agnostic to erratic dragging and clicking. Thanks for the thorough research!
    – Anton S.
    Nov 12, 2020 at 15:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .