Closed Bug 285052 Opened 20 years ago Closed 3 years ago

textbox and textarea ignore ctrl+letter and alt+letter key combinations

Categories

(Core :: Widget: Win32, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 197474

People

(Reporter: jhargraveiii, Unassigned)

References

Details

(Keywords: intl)

Attachments

(2 files)

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050305 Firefox/1.0+

Note: used to be part of see bug 280527.

Firefox is not playing nice as it should with keyboard events since we have no 
problems with most Windows applications. I've confirmed the behavior under 
Windows 2000 and XP with the latest Firefox 1.01.

Here's my post to the I18N newsgroup:

We have a custom Tongan keyboard built with Keyman 
(http://www.tavultesoft.com/). To produce the acute version of the vowels the 
users press the control key plus the vowel. For example ctrl+a = á.

The alt+vowel keys produce a macron (ā) and worked fine with earlier versions 
of FireFox (up to 1.01?). It looks like the ctrl/alt key events are being eaten 
by FireFox.

I should add that we have seen the same bug in some Windows applications.  
Trados TagEditor (www.trados.com) and Atril's DVX for example. These are 
translation tools. 

It must depend on how the underlying implementation handles keyboard events 
since Notepad, Wordpad, Word, OpenOffice and Internet Explorer function as 
expected.

We've contacted Tavultesoft and they say that it is a problem with the 
application (Firefox 1.01).

Tavultesoft mentioned that Microsoft has published guidlines on how to make MS 
applications "keyboard friendly".

This may also be an issue with custom Microsoft keyboards - I will try to 
confirm this asap.

Reproducible: Always

Steps to Reproduce:
1. Display a page with a HTML textarea or XUL textbox.
2. Place cursor in the text control.
3. Enable Keyman keyboard.
4. Type ctrl-a or alt+a
Actual Results:  
No input is produced in the text control.

Expected Results:  
We should have seen for ctrl-a = á or alt-a = ā.  (Try same test with Internet 
Exporer to see the correct output)

I will submit sample keyman and Microsoft keyboards asap.
*** Bug 285049 has been marked as a duplicate of this bug. ***
Keywords: intl
Here is a test Microsoft keyboard that demonstrates Firefix eating keyboard
events with a ctrl key prefix. 

Instructions:

1. Unzip file.
2. Install Keyboard.
3. Select English Keyboard: "Test Ctrl+Vowel to Produce Acute vowel" (use
Windows XP "Languge Bar")
4. Open notepad and press ctrl-e, ctrl-i, ctrl-u - you should see the acute
versions of the vowels.
5. Now try with Firefox in a textarea or XUL text box - you will not see any 
output at all or even the triggering of short cut function (i.e, ctrl-a =
select all)
This is the promised Keyman keyboard. 

Instructions:
1. Download Keyman (http://www.tavultesoft.com/).
2. You should see the keyman icon (grey "key" with a letter k) on your task
bar.
3. Once keyman is installed double click on the file mozilla_test.kmx - this
will install the test keyboard.
4. Launch the application you want to test and place your cursor in the
textbox/textarea.
5. Left click the Keyman icon and select the "Mozilla Test Keyboard"

Try to type ctrl+a,e,i,o,u or alt+a,e,i,o,u in Internet Explorer and Firefox.
For IE you will see the accented vowels or vowels with macrons as expected. In
FireFox you see no output at all. Try Notepad, Word, OpenOffice to see that
they all work as expected.

Note that with FireFox 1.01 and earlier the alt key keystrokes produce correct
results!!

Here's what the keyboard code looks like:
c CTRL Keys
+ [CTRL K_A] > U+00E1 
+ [CTRL K_E] > U+00E9 
+ [CTRL K_I] > U+00ED 
+ [CTRL K_O] > U+00F3	   
+ [CTRL K_U] > U+00FA  

c ALT Keys    
+ [ALT K_A] > U+0101   
+ [ALT K_E] > U+0113   
+ [ALT K_I] > U+012B   
+ [ALT K_O] > U+014D	   
+ [ALT K_U] > U+016B	 

NOTE: I have a EXE which does a complete install of Keyman and the Test
keyboard - but it ws 700K and too big to attach. Let me know by email if you
want this esier method to install the keyboard (avoids the Keyman download)
Assignee: firefox → win32
Component: General → Widget: Win32
Product: Firefox → Core
QA Contact: general → ian
Version: unspecified → Trunk
With fix for bug 287179 (https://bugzilla.mozilla.org/attachment.cgi?id=181960)
the test keyboard works fine. I can enter accute wovels in textbox.
Status: UNCONFIRMED → NEW
Depends on: 287179
Ever confirmed: true
I am the author of Tavultesoft Keyman - I found out about this bug independently from a Keyman user.  I have reviewed this issue and duplicated it on my test computer.

The problem is that nsWindow::onChar is making assumptions about the status of WM_CHAR messages based on the state of the modifiers.  When a WM_CHAR message is received in Windows, it should always be processed as a character generating event - regardless of the state of the modifiers.  This fits the specification given on http://www.mozilla.org/editor/key-event-spec.html.

A special case is currently made in nsWindow::onChar to avoid this problem for Ctrl+Alt (which is generated by AltGr on some standard Microsoft keyboards).  IMHO this special case should be used as the behaviour whenever a WM_CHAR message is received - all modifiers should be ignored when generating a KeyPress event.
Bug 69954 contains a patch for TRUNK for this issue but I think it is important enough to warrant a port back to Firefox 2.0.

Tavultesoft originally made a workaround for this broken behaviour in Firefox but FF2.0 breaks the workaround (as it is non-compliant behaviour anyway).  The Bug 69954 patch should fix the problem properly.
Assignee: win32 → nobody
QA Contact: ian → win32
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: