Open Bug 280805 Opened 20 years ago Updated 5 years ago

Keypress events generates unshifted charcode for Cmd+Shift key combos

Categories

(Core Graveyard :: Widget: Mac, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

People

(Reporter: nalp, Unassigned)

References

(Blocks 1 open bug, )

Details

(Keywords: intl)

User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.5) Gecko/20041217 Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.5) Gecko/20041217 With the Swiss German keyboard + is SHIFT 1. When I want to increase text size (key OPTION +) I press SHIFT OPTION 1 (which works well under Safari). But the browser often (not always) behaves as I'd have pressed OPTION 1. No problem with the US keyboard (SHIFT OPTION =). Reproducible: Sometimes Steps to Reproduce: 1. Use Mac OS X 10.3 Panther 2. Switch to Swiss German keyboard 3. Try SHIFT 1 (to see that you get +) 4. Load a web page 5. Press SHIFT OPTION 1 Actual Results: Another window opens as if you'd pressed OPTION 1 (menu Window -> Navigator) Expected Results: Increased the text size Firefox has same problem. US keyboard seems to work fine (SHIFT OPTION =). I couldn't set the correct version of the OS in Bugzilla. It is Mac OS X 10.3 Panther.
Version: unspecified → 1.7 Branch
The bug disappears after you have selected menu View -> Text Zoom -> Larger to increase text size, but reappears if you open a new window. Steps to Reproduce: 6. Execute steps 1. to 4. 7. Select menu View -> Text Zoom -> Larger 8. Press SHIFT OPTION 1 Result: There's no bug. The text gets resized as intended. 9. Close the window 10. Execute steps 4. and 5. Result: There's the described bug again (ignored Shift key).
Assignee: download-manager → sfraser_bugs
Component: Download Manager → Widget: Mac
OS: other → MacOS X
Product: Mozilla Application Suite → Core
Correction: I mixed up Option and Command key! So, whenever you read OPTION think COMMAND (the open apple key) instead. Sorry for the confusion.
Summary: Shift key gets sometimes ignored in non-US keyboard → Command-Shift key combinations don't work in non-US keyboard
Severity: minor → normal
Making this the mac "version" of bug 287179. Changing summary a bit and confirming (recent suite trunk build). To reproduce, load attachment #55849 [details] and try different combinations of shift+key and cmd+shift+key on the line of keys below the function keys (1-9, = etc) For instance: On my Swedish kb, the second key to the left of the backspace key is "+", pressing shift++ will produce a "?" In the testpage I get the following results: Pressing + --> charCode=43 Pressing Shift++ --> charCode=63 Pressing Cmd+Shift++ --> charCode=43 I would expect charCode=63 to be generated for Cmd+Shift++ Marking intl since this is an issue when localizing the mapping of the cmd+? Help shortcut.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: intl
Summary: Command-Shift key combinations don't work in non-US keyboard → Keypress events generates unshifted charcode for Cmd+Shift key combos
Version: 1.7 Branch → Trunk
Please be careful: Don't forget that it SEEMS to work AFTER one selects View->Text Size->Increase or Decrease in the menu, at least for the Swiss keyboard. The key events still aren't right but the text size gets increased and decreased anyway. Perhaps there is already a work-around of sort and if you correct the char codes you could break that work-around (just a wild guess)? Or there is a second bug interacting with this one? To reproduce please turn on the Swiss keyboard and restart Firefox (restarting is important). 1. Open the attachment of Stefan 2. Hit Shift-Command-1 and other combinations to get a feeling 3. Select View->Text Size->Increase 4. Hit Shift-Command-1 Result: - no keypress and keydown events anymore (!!!) - charcode is 49 instead of 43
Assignee: sfraser_bugs → joshmoz
QA Contact: mac
I documented the very same behaviour with the 'Text-size' keyboard shortcut on a Japanese (Shift-JIS) keyboard in bug 273208. One additional observation: I changed the keyboard shortcut through the System Preferences > Keyboard and Mouse panel, and set it to Command - F12 (no shift modifier used). This has exactly the same problem: doesn't resize text upwards unless one goes first to the menu and click once on 'Text Size' (no need to select 'increase').
I just downloaded Firefox 1.5 RC2 on Mac OS X 10.4 and this bug is still the same. Is someone working on this bug?
Appears to be a duplicate of bug #88380 (linking to oldest reported bug)
(In reply to comment #7) > Appears to be a duplicate of bug #88380 > (linking to oldest reported bug) > This is a general mac issue. Not really the same issue as bug 88380. See comment #3 for a description.
Actually, I'm not sure. I went and looked at Bug #287179, which this thread seems to apply is the windows version, but that seems to talk about ctrl-shift not generating the shifted keycodes for all keys, not just some keys. ctrl-shift-a behaves as expected, just things like +,- and the strange keys around the edges that don't work. In the below map, the two lines with ##### appended, should have generated the same charCode, but they didn't. Unless this bug is meant to somehow cover that on macs, sometimes it works and sometimes it doesn't? Whatever :) This bug, bug #287179 and bug #88380 all look like getting fixed at about the same time (never) so it probably doesn't matter much. The below map is the three keys coming in from the right from backspace/delete. # where three chars are listed for a key, it's normal, shifted, and alt-gr for that key # main keyboard -,_ 13) keydown charCode=0 keyCode=219 character=|| 14) keypress charCode=45 keyCode=0 character=|-| ##### 15) keyup charCode=0 keyCode=219 character=|| # main keyboard ö,Ö,\ 16) keydown charCode=0 keyCode=61 character=|| 17) keypress charCode=246 keyCode=0 character=|ö| 18) keyup charCode=0 keyCode=61 character=|| # main keyboard 0,=,} 19) keydown charCode=0 keyCode=48 character=|| 20) keypress charCode=48 keyCode=0 character=|0| 21) keyup charCode=0 keyCode=48 character=|| # main keyboard -,_ with ctrl 1) keydown charCode=0 keyCode=219 character=|| modifiers=Ctrl 2) keypress charCode=0 keyCode=219 character=|| modifiers=Ctrl ##### 3) keyup charCode=0 keyCode=219 character=|| modifiers=Ctrl # main keyboard ö,Ö,\ with ctrl 4) keydown charCode=0 keyCode=61 character=|| modifiers=Ctrl 5) keypress charCode=61 keyCode=0 character=|=| modifiers=Ctrl 6) keyup charCode=0 keyCode=61 character=|| modifiers=Ctrl # main keyboard 0,=,} with ctrl 7) keydown charCode=0 keyCode=48 character=|| modifiers=Ctrl 8) keypress charCode=48 keyCode=0 character=|0| modifiers=Ctrl 9) keyup charCode=0 keyCode=48 character=|| modifiers=Ctrl # num pad - key #### charCode=45+Ctrl works to shrink 36) keydown charCode=0 keyCode=109 character=|| modifiers=Ctrl 37) keypress charCode=45 keyCode=0 character=|-| modifiers=Ctrl 38) keyup charCode=0 keyCode=109 character=|| modifiers=Ctrl
Blocks: 308565
Depends on: 317245
There's a real bug swarm here.
Depends on: 284251
Yes, it is a bug swarm and even a cross-platform one. Might I remind you that this bug (and related bugs) is not yet resolved with the new Firefox release 1.5.0.1? I tried this out under Windows, too, and there is the same effect: Shift-Control-1 (for Windows) or Shift-Command-1 (for Macintosh) does not enlarge text-size for Swiss German keyboard. I studied other related bugs and I have the impression that there is a design problem in the key event handling somewhere deep in the Mozilla core. Perhaps it seems a bit esoteric needing Shift-Control or Shift-Command. But it would be helpful for laptop owners with non-us keyboards.
Assignee: joshmoz → nobody
I notice that keyup events seem to always give me the unshifted key, even though the shifted key was keypressed. For example, Cntrl+Shift+2 gives me the charCode for @ on keypress, but it gives me the charCode for 2 on keyup. Is that correct? I see the same thing for Option+Shift+key and Cmd+Shift+key; they keyup is the unshifted key. However, I did notice that many (all?) Cmd+Shift+num give me a keypress but no keyup at all.
(In reply to comment #13) > I notice that keyup events seem to always give me the unshifted key, even > though the shifted key was keypressed. > > For example, Cntrl+Shift+2 gives me the charCode for @ on keypress, but it > gives me the charCode for 2 on keyup. Is that correct? keydown and keyup events attempt to describe a physical key, and so should have a charCode of 0. The physical key information is in the keyCode field. https://developer.mozilla.org/En/DOM/Event.keyCode ("Unicode value" is not very accurate though - some keys don't have Unicode values.) keypress will provide a character in charCode if the key combination represents a printable character. https://developer.mozilla.org/En/DOM/Event.charCode See also http://www.mozilla.org/editor/key-event-spec.html. It is old but the table is helpful. > However, I did notice that many (all?) Cmd+Shift+num give me a > keypress but no keyup at all. That sounds like a (different) bug.
Re the original issue in comment 0, does Firefox 3 behave as expected? (There were changes related to that situation.)
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.