Closed Bug 1777666 Opened 2 years ago Closed 2 years ago

Alt+Number keyboard shortcuts for spaces toolbar hijacks Windows Alt codes for entering special characters, signs and symbols in text input fields

Categories

(Thunderbird :: General, defect, P5)

Thunderbird 102
Unspecified
Windows

Tracking

(thunderbird_esr102? fixed, thunderbird104 fixed)

VERIFIED FIXED
105 Branch
Tracking Status
thunderbird_esr102 ? fixed
thunderbird104 --- fixed

People

(Reporter: stepand76, Assigned: aleca)

References

(Blocks 1 open bug, Regression, )

Details

(Keywords: intl, regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0

Steps to reproduce:

  1. Open Address Book.
  2. Create new contact.
  3. Type Alt+0150 (N dash) into the Name field.

Same problem is on many other places. For example in Calendar in new event tab.

Actual results:

When I type 1 (while Alt is still pressed) it activates the mail tab.

Expected results:

Alt+Number keyboard shortcuts shouldn't be allowed.

Thanks. Confirming.

Regressed by https://phabricator.services.mozilla.com/D142014.

Windows allows using Alt Codes for entering at least 256 different special characters, signs and symbols in text input fields. Works in Firefox, fails in TB. Worse, we block loads of them as we also respond to Alt+01.. so any random digits within the up to 4 digits Alt codes will trigger our shortcuts. Not good. Alt+0150 (N dash) is a good example that such shortcuts are actually needed for everyday text input, e.g. in composition.

Need to figure out something better here (some sort of compromise), we cannot just hijack the entire set for text inputs.
Not urgent compared to other bugs atm, workaround is to generate special chars somewhere else and copy and paste into TB.

Fyi, stepand76, we had a hard time finding these shortcuts already because Ctrl+number key are taken for switching to the n-th tab in TB/FF, and Ctrl+Alt+* is Windows application startup shortcuts territory.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Component: Untriaged → General
Ever confirmed: true
Keywords: regression
OS: Unspecified → Windows
Priority: -- → P5
Regressed by: spaces-toolbar
Summary: Alt+Number keyboard shortcut work in text fields → Alt+Number keyboard shortcuts for Thunderbird spaces hijack Windows Alt codes for entering special characters, signs and symbols in text input fields

https://altcodeunicode.com/ has the list of permitted Alt Codes for Windows text inputs. There might be more above 256, but not sure if those are regularly working.

☺ ALT 1 White smiling face, smiley face U+263A
☻ ALT 2 Black smiling face U+263B
♥ ALT 3 Black heart suit U+2665
♦ ALT 4 Black diamond suit U+2666
♣ ALT 5 Black club suit U+2663

I wouldn't mind if we hijacked only those 5, but we're hijacking all 256+ of them as explained above, that's odd.
That said, I recall vaguely there might be alternative ways to enter those on windows.

In composition, Insert > Characters and Symbols only covers a small subset.

Hmm. We don't seem to have much choice in this area:

  • Ctrl+<num> is taken by the tab switching.
  • We can't use something like Ctrl+Shift+<num> because the event.key will not be a number but whatever symbol you get when you hold Shift.
  • We can't use event.code to address this either because it doesn't always line up with what is printed on the keyboard.
  • Ctrl+Alt+<num> or Meta+<num> might work, but they seem likely to be a desktop shortcut or not received by the application at all. I'm not sure what the conventions are on microsoft windows.
Blocks: tb102found

Yes basically every shortcut is taken. But there is no strict requirement to have keyboard shortcuts for these.

Summary: Alt+Number keyboard shortcuts for Thunderbird spaces hijack Windows Alt codes for entering special characters, signs and symbols in text input fields → Alt+Number keyboard shortcuts for spaces toolbar hijacks Windows Alt codes for entering special characters, signs and symbols in text input fields

Alex, Henry,

Is it incorrect that alt combo is the primary means of entering intl characters without an intl key ?
If it is the primary means, then this MUST get quick attention and resolution - we can't leave our intl users high and dry.

Flags: needinfo?(alessandro)
Keywords: intl

I'll take care of this, trying to find a solution.
if that's not possible, the new shortcut manager allows us to disable those shortcuts only for Windows pretty easily.
These issues will not happen anymore once we implement customizable shortcuts, allowing users to change or disabled whatever they want.

Assignee: nobody → alessandro
Flags: needinfo?(alessandro)

If I'm not wrong, the ALT text only works with numbers from the Numpad, is that correct?
Trying with the regular number rows below the function keys I don't get any special characters anywhere.

If that's the case, we can use the KeyboardEvent.location: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/location
This will tell us the region a key is pressed from, and if it comes from the Numpad, we can not hijack it for those shortcuts.

A fix that should be good for 102, and then we can ignore it once we implement customizable shortcuts.

Status: NEW → ASSIGNED
Attachment #9288574 - Attachment description: Bug 1777666 - Do not hijack number key event for spaces tabs if triggered from Numpad. r=#thunderbird-reviewers → Bug 1777666 - Do not hijack number key event for spaces tabs if triggered from Numpad. r=thomas8
Target Milestone: --- → 105 Branch

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/a3eb7ab294f7
Do not hijack number key event for spaces tabs if triggered from Numpad. r=thomas8

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED

Comment on attachment 9288574 [details]
Bug 1777666 - Do not hijack number key event for spaces tabs if triggered from Numpad. r=thomas8

[Approval Request Comment]
Regression caused by (bug #): bug 1665511
User impact if declined: Inability to input special character on Windows with the key combination Al+NumPad number
Testing completed (on c-c, etc.): on c-c
Risk to taking this patch (and alternatives if risky): very low as hardcoded spaces toolbar shortcuts are ignored if the keydown event is triggered from the numpad.

Attachment #9288574 - Flags: approval-comm-esr102?
Attachment #9288574 - Flags: approval-comm-beta?

Comment on attachment 9288574 [details]
Bug 1777666 - Do not hijack number key event for spaces tabs if triggered from Numpad. r=thomas8

[Triage Comment]
Approved for beta

Attachment #9288574 - Flags: approval-comm-beta? → approval-comm-beta+

Comment on attachment 9288574 [details]
Bug 1777666 - Do not hijack number key event for spaces tabs if triggered from Numpad. r=thomas8

[Triage Comment]
Approved for esr102 (optimistically)

Thomas, can you test this on beta on Tuesday?

Flags: needinfo?(bugzilla2007)
Attachment #9288574 - Flags: approval-comm-esr102? → approval-comm-esr102+

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

Thomas, can you test this on beta on Tuesday?

Yes, verified fixed on 105.0a1 (2022-08-15) (64-bit) and 104.0b4 (64-bit), Win10.

Status: RESOLVED → VERIFIED
Flags: needinfo?(bugzilla2007)

Oh, had taken a screenshot, too: Alt+NumPad number keys (1-5) creates Unicode characters

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: