Closed Bug 253680 Opened 18 years ago Closed 12 years ago

VK_HELP should be triggered by Cmd+? on Mac

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 432112

People

(Reporter: steffen.wilberg, Unassigned)

References

Details

Attachments

(2 files)

I'm trying to make Ctrl/Cmd+? open Help Contents on Mac. (That means you have to
press Shift as well on US and German keyboards.) But |key="?" modifiers="accel"|
doesn't work.

Testing with the Dean's keyboard tester
(http://bugzilla.mozilla.org/attachment.cgi?id=55849&action=view) and pressing
"?" with Shift or Ctrl+Shift results in:

Firefox trunk build (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a3)
Gecko/20040729 Firefox/0.9.1+))
*** German keyboard layout ***:
1) keydown charCode=0 keyCode=219 character=|| modifiers=Shift
2) keypress charCode=63 keyCode=0 character=|?| modifiers=Shift
3) keyup charCode=0 keyCode=219 character=|| modifiers=Shift

4) keydown charCode=0 keyCode=219 character=|| modifiers=Ctrl+Shift
5) keypress charCode=0 keyCode=219 character=|| modifiers=Ctrl+Shift
6) keyup charCode=0 keyCode=219 character=|| modifiers=Ctrl+Shift

*** US keyboard layout ***:
7) keydown charCode=0 keyCode=191 character=|| modifiers=Shift
8) keypress charCode=63 keyCode=0 character=|?| modifiers=Shift
9) keyup charCode=0 keyCode=191 character=|| modifiers=Shift

10) keydown charCode=0 keyCode=191 character=|| modifiers=Ctrl+Shift
11) keypress charCode=47 keyCode=0 character=|/| modifiers=Ctrl+Shift
12) keyup charCode=0 keyCode=191 character=|| modifiers=Ctrl+Shift

I guess character should be |?| in no. 5 and 11.

====================================================
Firefox aviary branch build (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.7) Gecko/20040730 Firefox/0.9.1+ (Steffen))
*** German keyboard layout ***:
1) keydown charCode=0 keyCode=219 character=|| modifiers=Shift
2) keypress charCode=63 keyCode=0 character=|?| modifiers=Shift
3) keyup charCode=0 keyCode=219 character=|| modifiers=Shift

4) keydown charCode=0 keyCode=219 character=|| modifiers=Ctrl+Shift
5) keyup charCode=0 keyCode=219 character=|| modifiers=Ctrl+Shift

*** US keyboard layout ***:
6) keydown charCode=0 keyCode=191 character=|| modifiers=Shift
7) keypress charCode=0 keyCode=191 character=|| modifiers=Shift
8) keypress charCode=63 keyCode=0 character=|?| modifiers=Shift
9) keyup charCode=0 keyCode=191 character=|| modifiers=Shift

10) keydown charCode=0 keyCode=191 character=|| modifiers=Ctrl+Shift
11) keypress charCode=0 keyCode=191 character=|| modifiers=Ctrl+Shift
12) keyup charCode=0 keyCode=191 character=|| modifiers=Ctrl+Shift

So the aviary branch has additional problems.

key="/" modifiers="accel,shift" works by the way, but only on US keyboards, and
it also displays Ctrl+Shift+/ in the menu, so that's not an option.
Blocks: 253693
Assignee: aaronleventhal → steffen.wilberg
I think that the Command-? key event should generate VK_HELP (for some reason
that didn't happen in the VK_HELP bug).  Is there any reason why VK_HELP event
should *NOT* be generated?
OS: Windows XP → MacOS X
Hardware: PC → Macintosh
Summary: Ctrl+? doesn't work → Command+? doesn't work
Aaron, how am I supposed to fix this? I know my way around chrome, but have
pretty little knowledge about backend stuff. This bug is about making key="?"
modifiers="accel" work, whereas bug 253693 is about using that in Firefox to
bring up Help once it works. I can certainly do the latter, but I don't have a
clue about this one.

Brade, VK_HELP doesn't work either right now, see bug 252750: It is triggered by
any key. I reopened the VK_HELP bug 124393 because of that. I don't know if
Cmd+? should trigger the same action as the Help key since I have no Mac.
Assignee: steffen.wilberg → aaronleventhal
OS: MacOS X → All
Hardware: Macintosh → All
Summary: Command+? doesn't work → key="?" modifiers="accel" doesn't work
Keywords: helpwanted
(In reply to comment #2)
> Aaron, how am I supposed to fix this? I know my way around chrome, but have
> pretty little knowledge about backend stuff. This bug is about making key="?"
> modifiers="accel" work, whereas bug 253693 is about using that in Firefox to
> bring up Help once it works. I can certainly do the latter, but I don't have a
> clue about this one.
> 
> Brade, VK_HELP doesn't work either right now, see bug 252750: It is triggered by
> any key. I reopened the VK_HELP bug 124393 because of that. I don't know if
> Cmd+? should trigger the same action as the Help key since I have no Mac.

I'll be at home in 2 hours, and I'll try to test on my Mac. Do I need a special
build, or is he lastest Firefox or Seamonkey sufficient ?
Seamonkey trunk and Firefox trunk should be the same. Seamonkey 1.7 could be
different. Firefox aviary branch builds are somewhat different (see comment 0).
If you want Mac builds to always produce VK_HELP events, the fix would go in
nsMacEventHandler.cpp around line 870
(http://lxr.mozilla.org/seamonkey/source/widget/src/mac/nsMacEventHandler.cpp)
by adding this line (with appropriate spacing):
  case '?':      raptorKeyCode = nsIDOMKeyEvent::DOM_VK_HELP;        break;

(A patch with the above could go in bug 124393 or here.)
I don't have a Firefox tree, only a mozilla tree.

I don't understand the root problem of bug 252750 so I'll comment more there.
iBook first generation, Mac OS X 10.2.8, US-keyboard, QWERTY layout
Note: ? is printed on the / key, you need shift to reach it. But I can see only
|/| in the log below. There's no difference between the latest Seamonkey and
Firefox.

----- Seamonkey
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8a3) Gecko/20040729

ctrl-?
1) keydown charCode=0 keyCode=79 character=|
Hey, don't know what happened here. I'll repeat it again.

----- Seamonkey
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8a3) Gecko/20040729

German layout (? is in upper right, shift-ß) :
ctrl-?
1) keydown charCode=0 keyCode=0 character=|
Attached file keys.txt
This isn't my day :-) I got caught up in some Unicode-cruft. Sigh.
Making VK_HELP triggered by Cmd+? on Mac would help me as well to fix bug
253693. But only if VK_HELP is not triggered by all sorts of keys, as reported
in bug 252750. :)

But why does key="?" modifiers="accel" not work? Have a look at the output in
comment 0, and in the keys.txt attached by Joe. Something's pretty broken.
Morphing bug. I don't care if |key="?" modifiers="accel"| doesn't work if I can
make Cmd+? trigger VK_HELP.
No longer blocks: 253693
Summary: key="?" modifiers="accel" doesn't work → VK_HELP should be triggered by Cmd+? on Mac
This is the second part of the patch I originally attached to bug 252750. It
includes an if-clause to check wheter the Cmd key has been pressed as well.

I don't have a Mac here, but this should only be triggered if Cmd+? is pressed,
which means Cmd+Shift+/ using an US keyboard layout, just like Cmd+! means you
have to press Ctrl+Shift+1.

VK_HELP should be triggered by F1 on other platforms than Mac. But I'll need
assistence if I'm supposed to fix that as well.
Assignee: aaronleventhal → steffen.wilberg
Status: NEW → ASSIGNED
Attachment #155023 - Flags: review?(brade)
QA Contact: bugzilla
Blocks: 253693
If I hit Shift+/ ("?"), then I get charCode = '?' in
ConvertMacToRaptorKeyCode().  If I hit Cmd+Shift+/ (Cmd+?), then I get a
charCode = '/'.  Not sure how to handle this.
Comment on attachment 155023 [details] [diff] [review]
from bug 252750, plus "if"

I'm worried about localization and internationalization issues for this patch. 
I don't think we should go down this path.
Attachment #155023 - Flags: review?(brade) → review-
Javier (comment 12)--ConvertMacToRaptorKeyCode returns a keycode (not a
charcode).  It returns '/' for charcode '?' because it maps to a US keyboard
(not i18n-friendly) and the '/' key is the key that is pressed (there isn't a
'?' keycode in gecko).
OS: All → MacOS X
Hardware: All → Macintosh
-> default owner.
Assignee: steffen.wilberg → aaronleventhal
Status: ASSIGNED → NEW
QA Contact: bugzilla
Mass un-assigning bugs assigned to Aaron.
Assignee: aaronleventhal → nobody
QA Contact: keyboard.navigation
This has been fixed on Fx3.0.
Status: NEW → RESOLVED
Closed: 12 years ago
Keywords: helpwanted
Resolution: --- → DUPLICATE
Duplicate of bug: 432112
Component: Keyboard: Navigation → User events and focus handling
You need to log in before you can comment on or make changes to this bug.