2

I'm trying to make my 97 years old grandma's laptop(Ubuntu 20.04) more accessible for her. She often is frustrated because mail text that she has written in Thunderbird message compose window 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 in Thunderbird message compose window so that selected text would be deselected instead of replaced, when typing?
  2. If changing the behavior is not possible, can I disable text selection via mouse in general?

Thanks for any technical hints or other ideas on how to address this! Possible answers might involve hidden Thunderbird settings/workarounds or instructions on how solve this via custom script/(web-)extension.

Note: To narrow this down this question is about how to solve this problem in Thunderbird message compose window specifically. I also asked this question for Libreoffice Writer and as a question on askubuntu.com for a system-wide solution.

Anton S.
  • 141

1 Answers1

2

Proof of Concept: userChromeJS addon + custom user script

To answer my own question: I managed to pull of this hack which deselects the current selection before the user continues typing.

If someone knows how to turn this into a real Thunderbird MailExtension, feel free to update this answer or start your own!

Setup

  1. Install the experimental Thunderbird-Addon userChromeJS
  2. Create a folder chrome inside your Thunderbird profile directory
  3. Create a text-file named userChrome.js there with the following content:
    function deselect(e) {
      if(e.ctrlKey || e.altKey || e.metaKey || e.keyCode === 16) {
        return; // don't do anything if those keys are pressed
      }
      let currentWindow = e.view
      let selection = currentWindow.getSelection(); 
      selection.collapseToStart();
    }
    window.addEventListener("keydown", deselect);
    
  4. Restart Thunderbird

Caveats

  • The userChromeJS addon is flagged experimental
  • This hack was tested with Thunderbird 68.10.0. It may not work with other versions.
  • It works for Thunderbird's messenger-composer window where you're typing your message content but currently not for other inputs like recipient etc.
  • There may be adjustments needed to handle edge cases
  • It currently listens to all keyboard presses from all Thunderbird windows
Anton S.
  • 141