Open Bug 1067053 Opened 10 years ago Updated 2 years ago

Tab switching shortcuts not processed correctly with Programmer Dvorak keyboard layout on OS X 10.6.8.

Categories

(Firefox :: Keyboard Navigation, defect)

32 Branch
x86
macOS
defect

Tracking

()

People

(Reporter: nmunson, Unassigned)

References

Details

(Keywords: regression)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:32.0) Gecko/20100101 Firefox/32.0
Build ID: 20140911151253

Steps to reproduce:

Pushlog:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=62c85e7fc6ad&tochange=6d8836257099

Steps:
1) Install and switch to the Programmer Dvorak Layout: http://www.kaufmann.no/roland/dvorak/macosx.html

2) Press Command-n 9 times to open 9 new tabs.

3)
Press Command-2
Press Command-{
Press Command-2
Press Command-}


Actual results:

Pressing Command-2 moved to the second tab.
Pressing Command-{ moved to the fourth tab.
Pressing Command-2 moved to the second tab.
Pressing Command-} moved to the fourth tab.


Expected results:

Pressing Command-2 correctly moves to the second tab.
Pressing Command-{ should have moved to the first tab.
Pressing Command-2 correctly moves to the second tab.
Pressing Command-} should have moved to the third tab.
Masayuki-san, could you have a look, please?
Blocks: 1008772
Component: Untriaged → Keyboard Navigation
Flags: needinfo?(masayuki)
Keywords: regression
Hmm, I'd like to know where is the "{" and "}" keys with the layout? I don't understand why both cases activate 4th tab:

> Pressing Command-{ moved to the fourth tab.
> Pressing Command-} moved to the fourth tab.
Flags: needinfo?(masayuki) → needinfo?(nmunson)
The { character is on the key assigned to the number 3 in the Querty layout.
The } character is on the key assigned to the number 4 in the Querty layout.

This would explain why Command-} might mistakenly move to the 4th tab, because that is the key it is on in Querty, but why Command-{ would also move to the fourth tab and not the third is a mystery to me.

If it helps at all, 
Command-} works as expected when there are 1 or 2 tabs open;
Command-} moves to tab 1 tab when there are 3 tabs open;
Command-} moves to tab 4 when there are 4 or more tabs open;
Command-{ only fails to work as expected when there are 5 or more tabs open.

Also,
Shift-4 on Querty produces the character 3 in Programmer Dvorak;
Shift-3 in Querty produces the character 5 in Programmer Dvorak.

Thank you so much for taking a look at this.

I hope this helps!
Flags: needinfo?(nmunson)
(In reply to nmunson from comment #3)
> The { character is on the key assigned to the number 3 in the Querty layout.
> The } character is on the key assigned to the number 4 in the Querty layout.

Do they mapped with Shift key?

> This would explain why Command-} might mistakenly move to the 4th tab,
> because that is the key it is on in Querty, but why Command-{ would also
> move to the fourth tab and not the third is a mystery to me.

Yeah, that's why I don't understand the behavior.

> If it helps at all, 
> Command-} works as expected when there are 1 or 2 tabs open;

I guess that the handler which handles Cmd-1~9 ignores the key combination.

> Command-} moves to tab 1 tab when there are 3 tabs open;
> Command-} moves to tab 4 when there are 4 or more tabs open;

This makes sense with the mapping you mentioned below.

> Command-{ only fails to work as expected when there are 5 or more tabs open.
> 
> Also,
> Shift-4 on Querty produces the character 3 in Programmer Dvorak;
> Shift-3 in Querty produces the character 5 in Programmer Dvorak.

Okay, this is the biggest hint of this bug.

I'd like to know what values are generated for keyCode and key value when only with Command key or with both Command key and Shift key.

You can check the DOM keyboard event values in
https://dvcs.w3.org/hg/d4e/raw-file/tip/key-event-test.html

Could you tell me the keyCode and key values at pressing:

* Command + }
* Command + Shift + }
* Command + {
* Command + Shift + {
Command + }
Event type	charCode	keyCode	which	shift	ctrl	alt	meta	key	code
keyup	0	224	224	✗	✗	✗	✗	'Meta'	-	LEFT
keypress	125 '}'	0	125 '}'	✗	✗	✗	✓	'}'	-	0
keydown	0	52 '4'	52 '4'	✗	✗	✗	✓	'}'	-	0
keydown	0	224	224	✗	✗	✗	✓	'Meta'	-	LEFT

Command + {
Event type	charCode	keyCode	which	shift	ctrl	alt	meta	key	code
keyup	0	224	224	✗	✗	✗	✗	'Meta'	-	LEFT
keypress	123 '{'	0	123 '{'	✗	✗	✗	✓	'{'	-	0
keydown	0	51 '3'	51 '3'	✗	✗	✗	✓	'{'	-	0
keydown	0	224	224	✗	✗	✗	✓	'Meta'	-	LEFT

Command + Shift + }
Event type	charCode	keyCode	which	shift	ctrl	alt	meta	key	code
keyup	0	224	224	✗	✗	✗	✗	'Meta'	-	LEFT
keyup	0	16	16	✗	✗	✗	✓	'Shift'	-	LEFT
keypress	51 '3'	0	51 '3'	✓	✗	✗	✓	'}'	-	0
keydown	0	52 '4'	52 '4'	✓	✗	✗	✓	'}'	-	0
keydown	0	16	16	✓	✗	✗	✓	'Shift'	-	LEFT
keydown	0	224	224	✗	✗	✗	✓	'Meta'	-	LEFT

Command + Shift + {
Event type	charCode	keyCode	which	shift	ctrl	alt	meta	key	code
keyup	0	224	224	✗	✗	✗	✗	'Meta'	-	LEFT
keyup	0	16	16	✗	✗	✗	✓	'Shift'	-	LEFT
keypress	53 '5'	0	53 '5'	✓	✗	✗	✓	'{'	-	0
keydown	0	51 '3'	51 '3'	✓	✗	✗	✓	'{'	-	0
keydown	0	16	16	✓	✗	✗	✓	'Shift'	-	LEFT
keydown	0	224	224	✗	✗	✗	✓	'Meta'	-	LEFT

I hope this helps.
Thanks.

Looks like that native key event indicates { or } for the key combinations. However, at computing keyCode, we prefer number key's keyCode. This is by design bug looks like keyCode of keydown and charCode of keypress are different. This is really a bug.

But I guess that we should refer .key value at handling keydown message instead of .keydown.
Status: UNCONFIRMED → NEW
Ever confirmed: true
> But I guess that we should refer .key value at handling keydown message instead of .keydown.

s/.keydown/.keyCode
Does this bug also manifest itself if using a French AZERTY layout? (which similar to Programmer Dvorak have the numbers in a shift state, but unlike it still have them on the same keycodes as regular QWERTY)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.