54

Is there a way to disable those evil keyboard shortcuts in Thunderbird?

When I accidentally hit a, suddenly the message gets archived and a new Archives folder is created. Similarly other keys bring havoc to my workflow.

While googling, I have found many complains similar to mine, but no working solution offered. There used to be a KeyConfig addon, but this is incompatible with new versions of Thunderbird.

My Thunderbird version is Icedove 24.6.0, but the problem still exists in Thunderbird 31.

αғsнιη
  • 40,939
  • 15
  • 71
  • 114
user1968963
  • 3,973
  • 13
  • 37
  • 56
  • You could try disabling the individual keyboard short-cuts for each using the keyconfig extension. https://support.mozilla.org/en-US/questions/920663 – slm Jul 10 '14 at 04:25
  • 3
    @slm - as I say in my question, the keyconfig addon is not compatible with new Thunderbird versions. – user1968963 Jul 10 '14 at 07:20
  • Hmmm. I have 24.5 and it works there. – slm Jul 10 '14 at 12:50
  • related bugreport: https://bugzilla.mozilla.org/show_bug.cgi?id=615957 – rubo77 Oct 08 '14 at 21:27
  • I also asked in the very active german forum at http://www.thunderbird-mail.de/forum/viewtopic.php?f=10&t=67901&p=372176#p372176 – rubo77 Oct 08 '14 at 22:06
  • 1
    @intika - new bounty, in case you are interested. – 400 the Cat Jan 23 '20 at 06:12
  • @400theCat sorry i was really busy lately and today as well :(... it will be for an other time for the bounty plus αғsнιη took the time to provide one solution... i will add any way an answer later with a userChrome.js solution... also an other answer to your other question were i had/have to add something more... (and will then delete this comment as it's off topic) – intika Jan 30 '20 at 23:52
  • 1
    @intika - if you have a solution using `userChrome.css`, I would create new bounty. – 400 the Cat Jan 31 '20 at 06:08
  • I wonder if an AutoHotkey script could be written for this purpose. Disable keyboard input unless window title starts with `Write:` or one of the modifier keys is being pressed? But you couldn't search... – endolith Apr 17 '20 at 21:39
  • @endolith has autoHotkeys been ported (to UNIX or Gnu/Linux)? – ctrl-alt-delor May 19 '20 at 06:32
  • It seems that you are the first person other than me, to think that making every surface of my computer ultra sensitive, and configured to do something stupid or dangerous, is not a good idea. (+1) – ctrl-alt-delor May 19 '20 at 06:41
  • @ctrl-alt-delor I'm sure there's some linux equivalent – endolith May 19 '20 at 23:35

5 Answers5

19

Without extension you can only disable some of it:

  • A can be disabled by disabling the Archive functionality in genereal, this has to be done in each Mail-Account under Copies and Folders->Keep messages archives in:
  • J can be disabled by disabling the Junk functionality, which is not a desired solution.

A better solution is the add-on tbkeys or tbkeys-lite.

To install this, follow the Readme, then open the settings for the extension and change the settings to this:

{
    "j": "window.goDoCommand('cmd_nextMsg')",
    "m": "window.goDoCommand('cmd_previousMsg')",
    "s": "window.goDoCommand('cmd_openMessage')",
    "k": "window.goDoCommand('cmd_reply')",
    "a": "window.goDoCommand('cmd_replyall')",
    "w": "window.goDoCommand('cmd_forward')",
    "c": "window.MsgNewMessage()"
}

which will remap all dangerous shortcuts to harmless actions. (I didn't remap "r" because I actually like this one)


For Thunderbird older than version 68, you could use keyconfig Add-On

To install this, you have to

  • right-click on the first word "keyconfig" in the old first forum post here from "April 30th, 2004"
  • install the keyconfig.xpi file in thunderbirds add-ons "as file"
  • open the settings for the extension "keyconfig 20110522", there you can disable (or change) all single-key-shortcut, you don't like (and also "Ctrl+Q" which is my favorite ;-)
AdminBee
  • 21,637
  • 21
  • 47
  • 71
rubo77
  • 27,777
  • 43
  • 130
  • 199
  • The keyconfig.xpi extension is also available on the [help article here](https://support.mozilla.org/en-US/kb/keyboard-shortcuts). Simply drag-and-drop onto the add-ons manager (Tools->Add Ons) works for an install, at least on Windows. – stevesliva May 07 '15 at 17:20
  • 1
    Neither of those are compatible with Thunderbird 68 – endolith Apr 17 '20 at 21:33
  • https://github.com/xiaoxiaoflood/firefox-scripts/tree/master/extensions/bootstrapLoader combined with https://github.com/xiaoxiaoflood/firefox-scripts/tree/master/extensions/keyconfig is supposed to work, but didn't for me :'( – endolith Apr 17 '20 at 21:56
  • 1
    check my updated answer, the extension ''tbkeys'' works for Thunderbird 78! – rubo77 Jul 19 '20 at 06:33
  • 2
    @endolith Check tbkeys-lite. ;) – Skippy le Grand Gourou Oct 14 '20 at 19:23
  • It seems not possible to disable Ctrl+Q shortcut with tbkeys, on GitHub it says "Defining a key sequence (meaning multiple keys in succession) where the first key combination in the sequence is the same as a built-in shortcut (like ctrl+j ctrl+k) is not supported. Single keys with modifiers may be mapped to override the built-in shortcuts but not sequences.". It can also be downloaded from addons menu (https://addons.thunderbird.net/en-US/thunderbird/addon/tbkeys-lite/). With Firefox, it is easier: https://superuser.com/questions/1318336/how-to-disable-ctrlq-shortcut-in-firefox-on-linux – baptx Apr 13 '21 at 12:01
6

You can disable the "a" problem by disabling email archives in general. This applies to all accounts.

Edit -> Preferences -> Advanced -> General -> Config Editor... mail.identity.default.archive_enabled -> false

Nathaniel M. Beaver
  • 1,246
  • 13
  • 28
kvbx
  • 181
  • 1
  • 6
  • Disabling functionality shouldnt be the wa to go. You wouldnt deinstall writing corrections as a fix to temporarily deactivate them, would you?! – WGRM May 20 '20 at 22:53
  • @WGRM but it's not kvbx's fault that Thunderbird offers no other solution – user1079505 Aug 25 '20 at 16:03
3

Sigh, this was a hard nut to crack. I wish there was more documentation.

The patch above posted by αғsнιη still works. There is a catch, however, if you are using a patched Thunderbird, which updates it self, you can't patch it again! By doing so you will probably break your Thunderbird. You need to download a completely fresh copy of Thunderbird and patch the omni.ja again. It is hard to predict when the patch will break so you should do patching via script.

I have taken a liberty and create a patch script called thunderbird-patch that can patch the omni.ja for you. You need to run it where your Thunderbird's directory is e.g. ./thunderbird-patch /usr/lib64/thunderbird.

It creates a backup of the original, unpacks it to /tmp/omni. There it patches the files which are needed and then it packs everything back again and stores it into original location.

One side note: The original omni.ja is using uncompressed zip file. The reason being that they wanted to have Thunderbird started as fast as possible. The script is using a compression, I did not notice any slowdowns of any kind. Should you experience those remove the compression.

The original file:

Archive:  backup_omni.ja
Zip file size: 51474524 bytes, number of entries: 5115
5115 files, 50486796 bytes uncompressed, 50486796 bytes compressed:  0.0%

The new generated file from the script:

Archive:  omni.ja
Zip file size: 15214620 bytes, number of entries: 5115
5115 files, 50486796 bytes uncompressed, 14226892 bytes compressed:  71.8%

(One more thing, omni.ja is a former jar file and that is the reason why it is just zipped file).

My patched omni.ja for Thunderbird 68.8.0 only (for any other version you have to patch it via script).

Edit: How to disable shortcuts like CTRL+Enter, and CTRL+SHIFT+Enter

Shortcuts containing Enter alias keycode VK_RETURN are using little bit different approach.

  • First to find the keycode at:

chrome/en-US/locale/en-US/messenger/messengercompose/messengercompose.dtd (comment out the line containing VK_RETURN)

<!ENTITY sendNowCmd.label "Send Now">
<!ENTITY sendCmd.keycode "VK_RETURN">
<!ENTITY sendNowCmd.accesskey "d">

<!ENTITY sendLaterCmd.label "Send Later">
<!ENTITY sendLaterCmd.keycode "VK_RETURN">
<!ENTITY sendLaterCmd.accesskey "L">
  • Secondly you need to find out key_send and key_sendLater:

chrome/messenger/content/messenger/messengercompose/messengercompose.xul (comment out both lines)

<key id="key_send" keycode="&sendCmd.keycode;" observes="cmd_sendWithCheck" modifiers="accel"/>
<key id="key_sendLater" keycode="&sendLaterCmd.keycode;" observes="cmd_sendLater" modifiers="accel, shift"/>

The sed to change it should be something like this:

sed -e '/^\s*<!ENTITY [^\.]*Cmd\.keycode "/{  s:^\s*:<!-- :; s:$: -->: ;}' \
    -e '/^\s*<key id="key_send[^"]*" keycode="&[^\.]*Cmd\.keycode;"[^/]*\/[^>]*>$/ { s:^\s*:<!-- :; s:$: -->: ; };' \
chrome/en-US/locale/en-US/messenger/messengercompose/messengercompose.dtd \
chrome/messenger/content/messenger/messengercompose/messengercompose.xul

Edit2: It works, I've just pushed the script changes. In order for the changes to work you need to remove your profile (perhaps --clearcache is enough?) completely and remove/uninstall your Thunderbird. Next do a fresh install of you Thunderbird. I have tested the changes on Opensuse and it works for me.

The Omni.ja copy above does not include the removal of the ctrl+enter and ctrl+shift+enter.

The modified patch script: thunderbird-patch.

intika
  • 13,920
  • 7
  • 41
  • 79
tukan
  • 4,876
  • 6
  • 19
  • @MartinVegter Check my findings. I have tried it on my Opensuse and it works. – tukan May 18 '20 at 11:45
  • do you know why the original script by αғsнιη did not work? You say there is a problem "if you are using a patched Thunderbird, which updates it self". I am not using patched, and my Thunderbird does not update itself. So what was the problem why it did not work when I tried the original script ? – Martin Vegter May 18 '20 at 13:03
  • @MartinVegter Do you have vanilla version installed? Did you compare the result to what I have posted to your changes? – tukan May 18 '20 at 13:21
  • "Why it did not work when you tried the script?" I can't guess what conditions you have before you tried the script (like profiles, other changes). – tukan May 18 '20 at 13:29
  • @MartinVegter I have tested it on both linux (opensuse) and Windows 10. I had similar issues on Windows 10. I had to delete the profile remove the Thunderbird. The make a fresh install. I have played around with the `--safe-mode` and also tried to run in `gdb`, to see what is wrong. – tukan May 18 '20 at 16:19
  • thank you. With your help, I was able to modify my files and disable most keyboard shortcuts. However, there are two that remain: `CTRL+Enter`, and `CTRL+SHIFT+Enter`, send email and send email later, respectively. Do you know which lines have to be commented, to disable these ? – Martin Vegter May 19 '20 at 09:14
  • @MartinVegter Great. I have created a similar patch for ctrl+enter (ctrl+shift+enter). I'll test it later on – tukan May 19 '20 at 14:05
  • @MartinVegter I have tested the changes and it works on Opensuse. I have modified the script and pushed the changes. – tukan May 20 '20 at 09:42
  • 1
    @tukan - perfect. Thank you very much. – 400 the Cat May 21 '20 at 05:16
  • @400theCat you are welcome. I found it fascinating that the web is full of people wanting this functionality, but nobody provided an answer to it. I don't understand why Thunderbird does not provide a configuration for the shortcuts. The OP is 5 years old! One more thing maybe `--clearcache` is enough to clean the profile, did not test it thou. – tukan May 21 '20 at 06:51
  • I tried this, but the annoying "j" for junk still exists, I couldn't notice any disabled shortcuts at all in TB 68.8.0 (64-Bit) on Ubuntu 20.04. I commented out the disabling of the commands "CTRL+ENTER" (i like those) in my branch: https://github.com/rubo77/thunderbird-remove-keyboard-shortcuts – rubo77 Jul 08 '20 at 12:30
2

The mentioned keyconfig 20110522 Add-On is not compatible with the latest Thunderbird releases (here v60.7.0).

I found dorando keyconfig which is a drop-in replacement. With it you can rebind nearly every keyboard shortcut.

dpat
  • 297
  • 2
  • 7
  • 4
    Now in new Thunderbird 68, `dorando keyconfig` does not work anymore. – 400 the Cat Jan 23 '20 at 06:10
  • @400theCat there is an issue concerned with updating it work with thunderbird >68 https://github.com/trlkly/dorando-keyconfig/issues/30 and also a first pull-request: https://github.com/trlkly/dorando-keyconfig/pull/32 maybe anyone wants to jump in to support. – white_gecko Feb 10 '20 at 15:47
0

Install tbkeys-lite plugin, then configure

{
    "a": "unset"
}

Ref: https://superuser.com/questions/1537337/anybody-know-of-a-way-to-disable-keybindings-in-thunderbird-68