Closed Bug 53029 Opened 24 years ago Closed 23 years ago

Menu highlight by ALT key should be cleared by next key event

Categories

(Core :: XUL, defect, P5)

x86
Windows 98
defect

Tracking

()

RESOLVED FIXED
mozilla0.9.9

People

(Reporter: masaki.katakai, Assigned: deanis74)

Details

(Keywords: intl, platform-parity)

Attachments

(1 file, 3 obsolete files)

ALT key will highlight Menu item for keyboard navigation. For example, on Message Compose window, 1) type ALT key File menu will be highlighted. 2) type DOWN key contents of File menu will be shown However, the highlight isn't cleared by next key event. 1) type ALT key File menu will be highlighted. 2) type 'a' key Mail Composer does not have 'a' menu, so the highlight should be cleared and 'a' needs to be inserted into input field. Please try the same operations on notepad on Windows. ALT key also will highlight the File menu, but next 'a' will clear the highlight and 'a' will be inserted. ALT key is used for ALT+HANKAKU/ZENKAKU to enable/disable IME. So I often meet this problem. Menu highlight grabs the key event.
Using Notepad on NT4, this is not the behavior. If I press and release Alt, the File item on the menu bar becomes active. Pressing 'A' then results in a beep, but the highlight is _not_ removed. .... Of course, thank MS for changing this on Win2000. Pressing the 'A' key now de-activates the menu bar. But nothing is inserted into the document.
I'm very sorry my first report is not correct. The behavior on Win98 is the same with Win2K that 'a' will de-activate menu bar, will not be inserted. However, on Mozilla, 'a' will not de-active the menu bar. That's problem.
ALT+HANKAKU/ZENKAKU enables IME. However, ALT+HANKAKU/ZENKAKU combination often activates menu bar on Mozilla. So menu bar will grab key event while composing. For example, return key should move to next line, but it will show File menu because menubar is active. On Notepad, I can not see this problem. However, on Mozilla, the same operation often activates menu bar. I'll file a separate bug.
The separate bug - http://bugzilla.mozilla.org/show_bug.cgi?id=53528 has been fixed. So now I think priority/severity is not high.
Severity: major → trivial
Priority: P3 → P5
Since Don has left, Vishy is taking his bugs in bulk, pending reassignment. thanks, Vishy
Assignee: don → vishy
yokoyama said it should be intl but not nsbeta1
Keywords: intl
Is there any compelling reason not to mark this WONTFIX?
I don't have any objection to mark this as WONTFIX. The separate bug 53528 has been fixed.
No, leave it open. If doing this on Win2000 deactivates the menu bar, we should do it. Keep up with the conventions of the latest OS. But don't change the severity from trivial. An important implementation note is that the Win2000 behavior is different for menu bars and menus. If I press "A" when the top-level menu bar is active and there's no corresponding item, the menu bar is deactivated. If I have a menu open, such as File, and press "A" when there's no corresponding item, the system beeps and the menu remains open. Shouldn't be too tough.
w2k nc4.75 alt;qq => *beep*q. The beep to be played per system sound rules and the menu should lose focus.
That's what I said, "If I press "A" when the top-level menu bar is active and there's no corresponding item, the menu bar is deactivated", isn't it?
you left out the beep.
Sorry, must have had my speakers too low! To restate... An important implementation note is that the Win2000 behavior is different for menu bars and menus. If I press "A" when the top-level menu bar is active and there's no corresponding item, the system beeps and the menu bar is deactivated. If I have a menu open, such as File, and press "A" when there's no corresponding item, the system beeps and the menu remains open. Shouldn't be too tough.
Dean, wanna take this? Probably needs to go to pink if not.
Assignee: vishy → dean_tessman
QA Contact: sairuh → jrgm
Sure. One question - how do I sound a beep? Since I'll be doing this for Windows only, I'll throw in the behavior where pressing the accelerator for a disabled menu item closes the popup chain.
Status: NEW → ASSIGNED
http://lxr.mozilla.org/seamonkey/source/widget/src/windows/nsSound.cpp#82 That menus dismiss when access keys for disabled items are pressed seems like a Windows flaw to me. Matthew, what do you think?
Component: Keyboard Navigation → XP Toolkit/Widgets: Menus
Keywords: pp
Personally, I like to maintain consistency with the platform unless there's a _really_ good reason not to. But whatever, I'll hold off on that last part for now.
Attached patch here it is (obsolete) — Splinter Review
This patch adds what I described before... If I press "A" when the top-level menu bar is active and there's no corresponding item, the system beeps and the menu bar is deactivated. If I have a menu open, such as File, and press "A" when there's no corresponding item, the system beeps and the menu remains open. It's only for Windows.
Keywords: patch, review
While I'm here, I'll attach a patch for the controversial behavior of pressing the access key for a disabled menu item dismissing the chain. I maintain that this is pp and we should do it.
Now I've got two patches here. 1) attachment 32259 [details] [diff] [review]: handles what to do on Windows when pressing an access key that doesn't correspond to a menu item. 2) attachment 32264 [details] [diff] [review]: dismisses the chain when pressing the access key for a disabled menu item or when pressing Enter when it's highlighted. Both of these mimic standard Windows behavior. Take what you want.
cc: pink - Mike, can you check these patches out (see my previous comment)? They're pretty straight-forward. (I promise, everyone, this is my last note on this bug for a while - sorry)
Target Milestone: --- → mozilla1.0
> That menus dismiss when access keys for disabled items are pressed seems like > a Windows flaw to me. Matthew, what do you think? Since when has the flawedness of an internally inconsistent Windows menu behavior discouraged us from reimplementing it faithfully? ... Ahem. In this case yes, I think the Windows 2000 behavior is correct. The most likely case is that the user has typed the mnemonics (and/or arrow keys) for a menu item at high speed, not realizing that the menu item in question is disabled. If we ding then close the menu, the user is alerted to the fact that the menu item didn't work. But if we leave the menu open, the user's subsequent key-presses (which they are expecting to go in the content area) may in fact activate other menu items, possibly causing dataloss.
OK, then I've got patches for both. Looking for an r=. My only concern is whether I did the beeping properly.
mpt: There's no beep for disabled menu items. I could add it, though, because I think it's a good idea. But I'm with you in that I think the menu should be dismissed.
timeless, care to review?
r=timeless for 1) and 2) [skipping cat's breath]
Keywords: reviewapproval
Pink, Blake wanted me to get an r= from you on this one. Can you take a quick look?
Attachment #32261 - Attachment is obsolete: true
Hyatt, can you take a look at this patch? It's windows-only.
moving up to 0.9.8. it's low-risk and windows-only. just need an sr=.
Target Milestone: mozilla1.0 → mozilla0.9.8
I'm tired of the struggle to get my patches reviewed. --> default owner
Assignee: dean_tessman → hyatt
Status: ASSIGNED → NEW
Dean, I don't think hyatt reads bugmail well, or at all. Did you try e-mailing him directly? I'm doing that now. /be
->99
Target Milestone: mozilla0.9.8 → mozilla0.9.9
dean, can you refresh my memory on what's going on here. The menu code has been swapped out and I can't find it in my paging table. why would we be calling DismissChain() here, and at what stage are we when this is being called?
Sure thing, Mike. I needed a refresher as well! attachment 32259 [details] [diff] [review]: Adds the behavior I summarized in comment 19. The patch for nsMenuBarFrame.cpp is in FindMenuWithShortcut(). If a Windows user presses Alt and then a key that isn't a valid access key on the menu bar (eg. 'X'), a beep is sounded and DismissChain() is called to deactivate the menu bar. Similar for the nsMenuPopupFrame.cpp patch, except it's obviously for popup menus and the menu remains open. attachment 32264 [details] [diff] [review]: Adds what I described in comment 20, and which mpt (grudgingly?) agreed with in comment 25. DismissChain() closes the menu.
ok 2 comments (now that I understand) 1) did you want to beep when dismissing the popup in patch 32264? 2) i'd prefer you not use the CID for creating a sound object if at all possible. use the prog id ("@mozilla.org/sound;1") instead. fix (2) and r=pink on both.
1) See comment 25 and comment 27. Windows doesn't beep, so my patch makes our menus work the same. 2) Sure thing. Uhh... how?
do_createInstance() can take a progid instead of a CID. just pass the string instead of the CID.
let's try this again -->me
Assignee: hyatt → dean_tessman
Status: NEW → ASSIGNED
Attachment #32259 - Attachment is obsolete: true
Attachment #32264 - Attachment is obsolete: true
Comment on attachment 69200 [details] [diff] [review] new single patch, addressing pink's concern r=pink from his comments. Need an sr=, please.
Attachment #69200 - Flags: review+
yes, r=pink ;)
Comment on attachment 69200 [details] [diff] [review] new single patch, addressing pink's concern Hyatt sez sr=hyatt
Attachment #69200 - Flags: superreview+
checked in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Component: XP Toolkit/Widgets: Menus → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: