Open Bug 615957 Opened 15 years ago Updated 2 months ago

Feature Request: disable single-key shortcuts

Categories

(Thunderbird :: Mail Window Front End, enhancement)

enhancement

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: jberkus, Assigned: KaiE)

References

()

Details

(Whiteboard: [workaround: comment 88])

Attachments

(2 files)

Currently Thunderbird has several single-key shortcuts for doing things with messsage, such as archive "A", mark as junk "J", etc. While I understand the utility of these for those who use them, for many of us they are an opportunity to accidentally archive or mark up mail because we mistake the active window. Something I have done 100's of times now, and I suspect other users have too. As such, I'd like a Preferences item which either allows me to turn off the single-key shortcuts, or force prepending another key to them, such as "ALT".
OS: Mac OS X → All
Hardware: x86 → All
Version: 3.1 → Trunk
Yes, this is so needed. It would also be good to know what single key commands there are and what they do so as to be able to fix them when it happens. Like when your e-mail disappeared and you don't know what happened. Single key commands like archive should never exist.
I agree my report duplicates these old one. Still, doesn't attaching it to a 3 years old unsolved report risk to help keeping untreated this bug highly dangerous to data ?
There wouldn't be any benefit in keeping separate bug reports open on the same issue, on the contrary. Duplicates are marked as such to keep all the relevant discussion in a single place. Unfortunately, I don't think that this report will gain much traction in the future either. There was an attempt once in bug 476590 to reduce the risk of accidental archiving of messages by hitting the 'A' keyboard shortcut, which ended up with a "won't-fix" resolution (see the discussion there). Personally, I sure support the proposal to make keyboard shortcuts configurable, and especially the single-key ones which are easy to hit accidentally.
Ok. BTW the attempt you mentionned as well as the discussion kept focus on "A" and only suggesting to change it to something else, or to improve undoing. While - there are plainty of other dangerous key (a,d,n,m,r,j...). And marking posts or threads as read can cause real issues as well when email deal with important issues. - the best solution, which is also the easiest, is at least a flag to switch-off hot keys, or one-letter keys, or flag for each individual key, or to possibility edit hotkeys. Some of these could be programmed in an afternoon, which is less than discussing about it. - undo-ing is both an overcomplex and inappropriate solution. - Inappropriate because I should think of the whole sentence eaten by the msg window and how many msg operation it has generated. - overcomplex because un-marking as read the right messages or part of threads is probably way more complicated than undoing the creation of directories in archive (wich is not done, BTW).
I'll also point out that the only solution given for disabling the "a" shortcut was to disable archiving entirely. This means that any user who doesn't want to archive stuff accidentally, but does want to use the archiving functionality in general, is screwed. The same goes for the "j" key; the only way to disable it is to disable Thunderbird's antispam functionality entirely. This is like being told that I can stop the car from backfiring by removing the engine. True, but hardly satisfactory.
See Also: → 581545
Is there a workaround available until this is implemented? for example, maybe you can add some commands to your pref.js like user_pref("keyconfig.main.xxx_key__NAME", "!][][][FUNCTION"); or a setting in about:config? discussions about this are going on here: http://superuser.com/questions/334191/how-can-i-customize-keyboard-shortcuts-in-thunderbird http://unix.stackexchange.com/questions/141523/disable-keyboard-shortcuts-in-thunderbird
[Keyconfig](http://forums.mozillazine.org/viewtopic.php?t=72994) is a plugin that allows you to configure keyboard shortcuts. To install you have to right-click on the first word in the (very old) first forum post "keyconfig" in the linked forum from "April 30th, 2004" and install the .xpi file in thunderbirds add-ons "as file" The link in that old post was updated when needed and still works (tested in Thunderbird 33)
Well, I meant solution supported and endorsed by Mozilla; but you're right, that's some way. As for the list of shortcuts, Wayne Sallee asked for, they're listed at https://support.mozilla.org/en-US/kb/keyboard-shortcuts.
Thanks Jan Sever. Wayne Sallee Wayne@WayneSallee.com (In reply to Jan Sever from comment #20) > Well, I meant solution supported and endorsed by Mozilla; but you're right, > that's some way. As for the list of shortcuts, Wayne Sallee asked for, > they're listed at https://support.mozilla.org/en-US/kb/keyboard-shortcuts.
There is now an extension to disable Ctrl+Q: https://addons.mozilla.org/en-us/firefox/addon/disable-ctrl-q-shortcut/ Maybe the same way you could create an extension to disable all single key shortcuts
That's not a "single-key" shortcut, though (and btw only works on Linux given that Windows doesn't use this shortcut for "Quit").
This feature is still annoying me, but I have found a way of making undoing the damage easier when you accidentally type in the Thunderbird window and watch in dismay as messages disappear: - swear - click on Tools menu - click on Activity Manager - sigh in relief as you see the list of recent actions on Inbox - manually put it all right - add your voice to this page in the hope that someday someone will disable these stupid single-key shortcuts by default
BTW, Keyconfig seems to be endorsed by Mozilla now as it's available on the same page they list what the shortcuts are: https://support.mozilla.org/en-US/kb/keyboard-shortcuts#w_customizing-keyboard-shortcuts I completely agree that single-key shortcuts are an insanely stupid concept - especially for a program that was made to be typed into! Also, it's ludicrous that those responsible for maintaining Thunderbird's otherwise excellent reputation have failed to make an appropriate change for 4+ years. The change SHOULD be to have options to dis-/enable and edit. An add-on is a backwards approach. This should be standard. I don't understand how a major piece of software came to be released WITHOUT this option.
Please, we don't need any more "me too" or "I can't believe this hasn't been fixed!" comments. Those don't help development in any way. Thunderbird is developed 100% by volunteers now, and we can't possibly find the time to work on every feature request that's been reported (There are literally hundreds and hundreds of open bugs). This is non-trivial to implement, and it may be quite some time before the core team has the means to fix it. However, we're always open to patches from anyone and would be glad to help out here or on IRC (#maildev @ irc.mozilla.org).
I have found the solution: Dorando keyconfig https://addons.mozilla.org/en-US/thunderbird/addon/dorando-keyconfig/ After a couple of weeks fishing emails out of trash I finally turned off one key delete, archive and all the other bugs. Note that these hot key issues are so easy to be burned by. You are searching or writing a message or even working (you thought) in another window but mouse focus somehow gets to the email list and BAM! -- any number of important emails quietly disappear. Trlkly deserves a medal. PLEASE make keyconfig a core feature.
I've updated the official Thunderbird help docs to point to the working version of the Dorando Keyconfig addon, as well as Menu Wizard, and to mention disabling single-key shortcuts with them. Hopefully that will help a little. Another thing that would help is to get Dorando Keyconfig fully reviewed. Currently it's "preliminarily reviewed / marked as experimental", which means it's not possible to search for it in the Thunderbird addon manager. Well, you can search for it, but you won't find it... If anyone can help out with that process, please head over to https://github.com/trlkly/dorando-keyconfig On the other hand, Menu Wizard does show up if you search Addons Manager for "keyboard shortcuts", yet we still have people unaware that there's a work-around. Menu Wizard has its own issues though. Maybe someone could make a simple modified version of Dorando Keyconfig with no UI, that just disables all the single-key shortcuts? Unfortunately I'm not able to do that myself. Barring someone stepping up to add the feature to Thunderbird itself, I'd suggest shipping such an addon with it. I would have stopped using Thunderbird years ago, if it wasn't for keyconfig. I think the single-key shortcuts should be considered a power-user option, disabled by default. I'd classify being unable to disable them as a critical/dataloss bug.
By the way, for those who aren't using Archiving feature at all – you can disable it per account in account settings β†’ Copies & Folders.
Great tip Rimas ! Just make sure and get anything that is in the archive folder before you do this, as the contents will be deleted! After changing the settings, restart Thunderbird. Now test it by pressing the (a) on an unimportant e-mail. Wayne Sallee Wayne@WayneSallee.com http://www.WayneSallee.com
If you want to have this changed, you can donate to this issue at https://www.bountysource.com/issues/3496829-feature-request-disable-single-key-shortcuts
I added a Request to change all Single click buttons with one click in the dorando-keyconfig addon at https://github.com/trlkly/dorando-keyconfig/issues/12
Beware that Dorando Keyconfig stopped working in Thunderbird 57 beta. Single-key shortcuts will be re-enabled, so be careful where you're typing, or you could accidentally change things or delete e-mails, as happened to me. I think this underscores the need for a built-in setting to disable these shortcuts. There's a preliminary fix for Keyconfig (unsigned) at the Github repository, see https://github.com/trlkly/dorando-keyconfig/issues/18 - I hope it can be added to addons.mozilla.org soon. Unfortunately, the current Thunderbird 58 beta broke even the fixed version of Keyconfig (and many other addons). See bug 1414398. I think that should be fixed in the next release of Thunderbird 58 beta, at which point the fixed version of Keyconfig should work again.
Fyi, a new version of Dorando Keyconfig is now available on AMO, thanks to Jonathan Kamens. Also, it's no longer "experimental", so you can find it easily with a search from within Thunderbird. It's working in all versions of Thunderbird - at least until support for non-restartless addons is dropped, which apparently will happen soon...
Hi, I am using thunderbird right now, with Enigmail. Before I can read any emails I have to enter a password. it's company policy. Because the password box isn't in scope, the password goes into the background application - thunderbird, and it causes all the emails to be marked as unread, some messages to be flagged as urgent for all I know some messages to be deleted. I have no way of knowing and this happens every morning. It's literally the most frustrating and annoying feature i've come across in any piece of software for as long as I can remember. Please can you disable single key shortcuts. Not in some plugin. Not in some 3rd party application. Not in some complicated option. IN THUNDERBIRD. BY DEFAULT. thank you.

We'd probably need bug 57805 for this request to happen. And so far Firefox hasn't implemented it.

(In reply to [:jberkus] Josh Berkus from comment #60)

At this point, there are no paid developers working on Thunderbird,

It doesn't affect the outcome for this bug, but in the interest of accuracy this hasn't been true for a few years.
More interesting perhaps, is that the add-ons community is today significantly more organized that it was a few months ago.

Also, many addons which were abandoned by their author have been revived by a newcomer, or the author was encouraged by the progress to resume support of the addon.

See Also: → 57805

(In reply to Wayne Mery (:wsmwk) from bug 1650997)

Where exactly are you clicking that it fails? And does the UI adequately indicate the field is clicked when you are successful? (In other words, is there a clear distinction between success and failure?)

I "work fast", so I quickly click on the Search field, but sometimes I just missed it (clicked close to it, but not exactly on it).
It's very rare cases, but it does happen sometimes.
When it does, and I start typing my search query quickly, I start doing all kind of things against my messages.

Simply, having one-key shortcuts is just a bad idea. I don't know of ANY other program that does it.
Shortcuts should always be together with the Ctrl key.

1). Main issue - Click on the quicksearch box then start typing, not realising that the cursor hasn't appeared in the search box, then the letters typed start destroying the emails - To me it feels like this got worse a year or so ago

2). (Because I'm running dual monitor)... Some other program show a flashing text cursor even when not in focus, leading me to believe I'm in that program, when in fact the focus is Tb - This is not Thunderbird's fault, but the damage is done to the emails in Tb.

3). This is just a gut feeling (I can't prove it and I could be totally wrong with this)... sometimes I think the quicksearch box loses focus for an instant when Tb downloads emails or does other background tasks.

For me, the issue would be 99.9% sorted if there was a option to disable single key shortcuts (even if just alphanumeric)

Been trying to get others at work onto Tb, but I know they are would hit this issue even more than me (based on having to help them find menus, toolbars etc. that have gone wandering)

AFAIK MS Outlook does not use any single key alphanumeric shortcut for an action - just for altering the screen view in some way, so not destructive.

Can donations be ring-fenced to an particular bug?

I'm also occasionally frustrated with this akward bug when start typing with bad cursor placement or window focus.
Some shortcuts (go to next message...) are only anoying, but shortcuts managing the e-mails are perilous.

Ten years and no improvement. Congrats Thunderbird Team! ;-)
And seriously: if it isn't possible to correct this ugly design bug, perhaps there's a way to make quick and dirty patch selectively blocking the most dangerous cases like "k" etc. (in about:config)?

(In reply to witrak from comment #74)

Ten years and no improvement. Congrats Thunderbird Team! ;-)
And seriously: if it isn't possible to correct this ugly design bug, perhaps there's a way to make quick and dirty patch selectively blocking the most dangerous cases like "k" etc. (in about:config)?

Actually there is an add-on that does just that.
Unfortunately, recent Thunderbird updates killed it.

Wayne Sallee
Wayne@WayneSallee.com

This is now my oldest open bug against any OSS project. Not sure how to feel about that.

All my marked as unread emails are now marked as read ("shift-c"). Fortunately, I also had marked them as important so the information is not really lost. Also I was able to unarchive the archived emails ("a") and, after about half an hour, un-ignore a thread which I had accidentally marked as ignore ("k").
So I want to get rid of most of the single keystroke commands (which I believe can be useful in text only mail clients or in mail clients which do not have a quick search bar).
I was able to disable all single key commands (plus two more in combination with shift) by commenting out related lines in
comm/mail/locales/en-US/chrome/messenger/messenger.dtd, as follows:
<!-- <!ENTITY archiveMsgCmd.key "a"> -->
<!-- <!ENTITY markThreadAsReadCmd.key "r"> -->
<!-- <!ENTITY markReadByDateCmd.key "c"> -->
<!-- <!ENTITY markAllReadCmd.key "c"> -->
<!-- <!ENTITY markStarredCmd.key "S"> -->
<!-- <!ENTITY markAsJunkCmd.key "j"> -->
<!-- <!ENTITY markAsNotJunkCmd.key "j"> -->
<!-- <!ENTITY killThreadMenu.key "k"> -->
<!-- <!ENTITY killSubthreadMenu.key "k"> -->
<!-- <!ENTITY watchThreadMenu.key "w"> -->
<!-- <!ENTITY nextMsgCmd.key "f"> -->
<!-- <!ENTITY nextUnreadMsgCmd.key "n"> -->
<!-- <!ENTITY nextUnreadThread.key "t"> -->
<!-- <!ENTITY prevMsgCmd.key "b"> -->
<!-- <!ENTITY prevUnreadMsgCmd.key "p"> -->
<!-- <!ENTITY tagCmd0.key "0"> -->

and the related lines in comm/mail/base/content/mainKeySet.inc.xhtml:
<!-- <key id="key_toggleFlagged" key="&markStarredCmd.key;" oncommand="goDoCommand('cmd_markAsFlagged');"/> -->
<!-- <key id="key_markJunk" key="&markAsJunkCmd.key;" oncommand="goDoCommand('cmd_markAsJunk');"/> -->
<!-- <key id="key_markNotJunk" key="&markAsNotJunkCmd.key;" oncommand="goDoCommand('cmd_markAsNotJunk');"
modifiers="shift"/> -->
<!-- <key id="key_markAllRead" key="&markAllReadCmd.key;"
oncommand="goDoCommand('cmd_markAllRead');" modifiers="shift"/> -->
<!-- <key id="key_markThreadAsRead" key="&markThreadAsReadCmd.key;" oncommand="goDoCommand('cmd_markThreadAsRead')"/> -->
<!-- <key id="key_markReadByDate" key="&markReadByDateCmd.key;" oncommand="goDoCommand('cmd_markReadByDate')"/> -->
<!-- <key id="key_nextMsg" key="&nextMsgCmd.key;" oncommand="goDoCommand('cmd_nextMsg')"/> -->
<!-- <key id="key_nextUnreadMsg" key="&nextUnreadMsgCmd.key;" oncommand="goDoCommand('cmd_nextUnreadMsg')"/> -->
<!-- <key id="key_nextUnreadThread" key="&nextUnreadThread.key;" oncommand="goDoCommand('cmd_nextUnreadThread')"/> -->
<!-- <key id="key_previousMsg" key="&prevMsgCmd.key;" oncommand="goDoCommand('cmd_previousMsg')"/> -->
<!-- <key id="key_previousUnreadMsg" key="&prevUnreadMsgCmd.key;" oncommand="goDoCommand('cmd_previousUnreadMsg')"/> -->
<!-- <key id="key_archive" key="&archiveMsgCmd.key;" oncommand="goDoCommand('cmd_archive')"/> -->
<!-- <key id="key_watchThread" key="&watchThreadMenu.key;" oncommand="goDoCommand('cmd_watchThread')" /> -->
<!-- <key id="key_killThread" key="&killThreadMenu.key;" oncommand="goDoCommand('cmd_killThread')" /> -->
<!-- <key id="key_killSubthread" key="&killSubthreadMenu.key;" oncommand="goDoCommand('cmd_killSubthread')" modifiers="shift" /> -->
<!-- <key id="key_tag0" key="&tagCmd0.key;" modifiers="shift any"
oncommand="goDoCommand('cmd_removeTags');"/> -->

I vote for disabling the single keystroke commands for now (and maybe enable them after it is possible to disable them via a Thunderbird configuration setting).

Before being able to offer a patch, I first have to read and understand the pages below https://developer.thunderbird.net/thunderbird-development/fixing-a-bug , and also test the patching process.

So if anyone else wants to build and offer a patch, ...

BTW The initial build of Thunderbird took more than an hour on my laptop but building it again after I made these changes took less than 30 seconds.

I came across the "tbkeys-lite" addon, which allows to unset key bindings for Thunderbird 68, until they are disabled by default (as common sense would require for modern computer usage).

SWEET!! tbkeys-lite works like a charm. Thank you so much for this suggestion.

Unbelievable that we still have to rely on addons to remove these shortcuts...

You can paste the following into the settings box of "tbkeys-lite" to really completely disable all one-letter shortcuts:

{
"0": "unset",
"1": "unset",
"2": "unset",
"3": "unset",
"4": "unset",
"5": "unset",
"6": "unset",
"7": "unset",
"8": "unset",
"9": "unset",
"j": "unset",
"k": "unset",
"o": "unset",
"f": "unset",
"#": "unset",
"r": "unset",
"a": "unset",
"x": "unset",
"c": "unset",
"u": "unset",
"b": "unset",
"m": "unset",
"p": "unset",
"s": "unset",
"t": "unset",
"w": "unset",
"]": "unset",
"[": "unset"
}

(taken from one of the reviews)

tbkeys-lite works on TB 78 as well! Yay!

I have gotten so used to the "Search when you type" feature in Firefox that I sometimes accidentally start typing in an open Thunderbird email, to search in it and as a result, messages are moved, archived, marked as junk, etc. where ideally, nothing should have happened.

The majority of Thunderbird users probably don't use the single key feature. Developers and super users of course do, but they are probably in the minority, in that way.

For the ordinary user, these single key shortcuts can be quite annoying, since you don't really know if important emails were deleted, marked as junk and moved or something else. And backtracking afterwards is near to impossible, to clean up after the damage is done.

My suggestion is to set single key shortcuts to disabled by default, yet allowing super users to enable single key shortcuts, either by adding this option under "Settings", disabled by default:

[ ] Enable single key shortcuts

... alternatively by adding a line in pref.js as previously suggested in this issue.

You can unset shortcuts with the tbkeys-lite add-on, but that forces the user to grant full access to the computer, which has security implications. Also, configuring tbkeys-lite isn't exactly a simple thing to do, whereas adding or removing a check mark is.

(In reply to tero gusto from comment #83)

My suggestion is to set single key shortcuts to disabled by default, yet allowing super users to enable single key shortcuts, either by adding this option under "Settings", disabled by default:

[ ] Enable single key shortcuts

... alternatively by adding a line in pref.js as previously suggested in this issue.

You can unset shortcuts with the tbkeys-lite add-on, but that forces the user to grant full access to the computer, which has security implications. Also, configuring tbkeys-lite isn't exactly a simple thing to do, whereas adding or removing a check mark is.

Any method allowing blocking the "feature" would be OK if only doesn't lead to unnecessary negative security implications, in this case - adding an extension. Thus the proposal of berndfinger in https://bugzilla.mozilla.org/show_bug.cgi?id=615957#c77 seems to be reasonable.

Pity that for 2 years nobody from developers tried to use it...

@Erik Blake - that focus issue doesn't happen to me, and this single-character commands issue is still an issue to me.
Gladly, the extension "tbkeys-lite" fixes the issue for me.

I disabled all single-character keys, except for "m" (Mark as Read), which is the only one I use, and if I ever do it accidentally, it's not a big issue (easy fix, doesn't delete emails or archive them, or initiates a rocket launch, etc)

{
"0": "unset",
"1": "unset",
"2": "unset",
"3": "unset",
"4": "unset",
"5": "unset",
"6": "unset",
"7": "unset",
"8": "unset",
"9": "unset",
"j": "unset",
"k": "unset",
"o": "unset",
"f": "unset",
"#": "unset",
"r": "unset",
"a": "unset",
"x": "unset",
"c": "unset",
"u": "unset",
"b": "unset",
"p": "unset",
"s": "unset",
"t": "unset",
"w": "unset",
"]": "unset",
"[": "unset"
}

I don't know anything about it, other than that it works. Of course I'd prefer Thunderbird to implement this natively.

The extension seems to be open source anyway: https://github.com/wshanks/tbkeys
(the GitHub page is linked in the extension page)

https://addons.thunderbird.net/en-US/thunderbird/addon/tbkeys-lite/

In the GitHub page, you have "Security, privacy, and implementation" section.
I don't see why giving a 1 star review just because of the lack of that section in the extension page.
Extensions could well just say "we're all safe and respect privacy", and yet behaving like a spyware...

1 star reviews will just demotivate the developer and then whenever Thunderbird decides to break extensions' compatibility once again, the developer may not feel motivated to spend time on fixing it.
I'm glad this extension exists.

I think we have pretty much exhausted suggestions of how to implement this, none of which has resulted in actual code, which is ultimately the purpose of these bug reports - versus complaints about add-ons, presumed simplicity of implmentation, random discussion, comments about unrelated bugs, etc. which is not within the purpose of this bug report. Therefore, with apologies to those of you who have contributed useful information, I am restricting further comments.

There have in fact been discussions amongst developers as to how this might be done, and it is something the developers plan to tackle., but it was not possible to do this for version 102.

Restrict Comments: true
Severity: normal → S3
Duplicate of this bug: 1880547

Note that this issue has now gotten much worse, because tbkeys is no longer supported as of TB 128. So there is once again, no way to block the single-key shortcuts.

Restrict Comments: false
See Also: → 1908233

(In reply to Josiah Bruner [:jsbruner] from comment #37)

Please, we don't need any more "me too" or "I can't believe this hasn't been
fixed!" comments.

This is non-trivial to implement

Surely it is straightforward. Just disable all single-stroke key shortcuts by default, and add option to enable them for those that want.

(In reply to Wayne Mery (:wsmwk) from comment #65)

We'd probably need bug 57805 for this request to happen. And so far Firefox hasn't implemented it.

No we don't. Firefox does not have such ridiculous existing keyboard shortcuts, and even if it did, would unlikely result in loss of data (being a browser rather than email client), so that issue is unlikely to be addressed anytime soon in Firefox.

All that is needed is

  • Disable all single-key or Shift+key keyboard shortcuts by default;
  • Provide option to re-enable them.

I'd be happy without the option to re-enable.

Duplicate of this bug: 1986124

Firefox introduced "about:keyboard" but it is still in alpha / beta phase but available in release client. I think it would be worth it if TB also take use of this and adapt it for TB keyboard shortcuts.

Today I've accidentally put a thing onto my keyboard, it lied on the spacebar, and for 3 seconds it marked lots of messages as read :(
Has happened to me several times in the past.
And it also happened when I tried to enter text while I was focused on the wrong window.
I think this bug needs a fix.

I've had also friends complain about that to me in the past, and they asked for a way to turn that off.
I think we should make that possible.

I happened to have a day off today, but ended up spending the majority of it finding a fix.

I suggest a pragmatic fix, without UI changes, that is less work than a full flexible configuration UI. Given the age of this bug, I suggest something simple, that only works with hidden prefs initially.
(If desired, we could expose that as checkboxes in the pref UI in a follow-up step.)

I wasn't aware that we already had a pref for the spacebar advance. I think it makes sense to keep that configuration switch independently, but I think it also makes sense to have a global switch to disable the single character presses, and I think it should cover the spacebar advance, too.

I'm attempting to move this bug forward, because as I understand, so far nobody was able to do the work.

The patch, and the text that follows below, was created with help from AI.

The patch I'm about to attach adds hidden preferences (about:config only, no UI) to stop accidental triggering of the mail window's bare single-key shortcuts (a=archive, k=ignore thread, the tag keys, message navigation, etc.), which fire from stray keypresses when focus lands in the wrong place. Behavior is unchanged by default; users opt in.

There are three modes via two prefs:

  • Completely off (mail.character_shortcuts.enabled=false)
  • Plain (default) β€” today's behavior, single keypress fires the shortcut.
  • Lead-in required (mail.character_shortcuts.use_lead_in_keypress=true) β€” the shortcut fires only just after a "lead-in" chord, Ctrl+a configurable character (mail.character_shortcuts.lead_in_control_key, default .), within a short period of time. This keeps the shortcuts available but unreachable by accident.

Spacebar "advance to next message" follows the same primary switch; Delete/Backspace and Enter have their own independent on/off prefs. Menus, toolbar buttons, and any modifier-based shortcuts are unaffected throughout.

Deliberately chosen Configuration limits: the lead-in is always Ctrl + one character, and that character must be a single non-whitespace character (empty, multi-character, or whitespace values are treated as "completely off" and logged as a warning to the Error Console, once per window). We do not restrict it to ASCII (international/non-Latin single characters are fine), and we do not check it against existing shortcuts β€” choosing a sane, non-conflicting key (e.g. not Ctrl+Q) is left to the user. The default . was picked because it seems unbound in the mail window and Firefox and is layout-independent.

Why was it implemented like this and not differently?

The naive approach could be a single global keydown listener that swallows the keys (what the tbkeys add-on seems to do via Mousetrap).
The reasons this wasn't done here:
(a) in the 3-pane the message list lives in the about:3pane child document, and a chrome-window key listener doesn't even receive those keystrokes β€” only Gecko's cross-document
XUL <key>/GlobalKeyListener does (which is exactly why these shortcuts are <key> elements in the first place)
(b) swallowing key events risks side effects on text input, the quick-filter/search box, and compose.

So instead the following approach is suggest, which seems to work.

We disable the shortcuts at the keyset level (disabled="true" on the <key>, which GlobalKeyListener honors live), which is inert and side-effect-free.

Three things needed extra handling that a keyset-only patch would miss:

  • macOS: those <key>s are also registered as native Cocoa menu key equivalents that fire before the disabled <key> is consulted, so we also strip the key reference from the referencing menu items (the menu item still works when clicked). A keyset-only disable looked correct but silently failed on macOS.
  • Spacebar isn't a <key>; it's gated once in the cmd_space command so every spacebar path is covered.
  • Enter isn't a <key> either; it's gated in the thread pane's keypress handler.

The lead-in is likewise implemented as a <key> (it briefly un-disables the others), not a JS listener, for the same cross-document reason. We also rejected disabling at the command level (e.g. cmd_archive), because that would disable the menu and toolbar entries too β€” and we want those to keep working.

Assignee: nobody → kaie
Status: NEW → ASSIGNED

In addition to the earlier patch, I've attached a second patch, which is much smaller. While the first patch contained exploration of additional ideas, the "minimal patch" it strictly limited to the behavior requested in this bug.

Here is an experimental add-on I made in my free time that implements the equivalent of patch #1
https://kuix.de/mozilla/thunderbird/disable-character-shortcuts/

Use at your own risk.
If this add-on helps you and you're using it, feel free to add a thumbs-up reaction to this comment, so we get some feedback whether it seen as helpful.

Otherwise, we should probably limit the discussion here in bugzilla to changes that could or should go into Thunderbird core.

See Also: → 2045550
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: