No way for page to disable audio cue when browser does not recognize shortcut

RESOLVED WORKSFORME

Status

()

Firefox
Keyboard Navigation
--
enhancement
RESOLVED WORKSFORME
14 years ago
14 years ago

People

(Reporter: Rich Liu, Assigned: Aaron Leventhal)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

There seems to be an audio cue when a hot key does not exist. However, I'm
writing  an browser based application that requires many hot keys by catch the
onkeyup event. Is there any way to disable the audio cue without having to turn
off the volume coming from the PC? 

Thanks in advance.

Reproducible: Always

Steps to Reproduce:
1. Press ALT + (Any key not currently marked as hot key with in browser)
2.
3.

Actual Results:  
My Javascript performs correctly. I was wondering if there's a way NOT to have
the  audio cue even though the hot key does not exist in Firefox. 

Expected Results:  
I would like the option to turn off the audio cue for unmarked hot key actions. 

I love everything else about Firefox. The application we're building is a
browser based application (http://resolution.net).
Not a security bug.

This appears to be normal windows behavior seen in many other programs including IE.
Group: security
(Assignee)

Comment 2

14 years ago
Any reason why onkeyup?

I recommend onkeydown, because:
1) It's early enough to prevent the default action of the event from occurring
(which is causing the beep).
2) It also works like that in IE.

Note that unfortunately cancelling the default action of the keydown only works
in nightly builds of Firefox:
http://ftp.mozilla.org/pub/mozilla.org/mozilla/nightly/latest-trunk/
If you want this to work with 1.0 you probably need to handle onkeypress for
Mozilla and onkeydown for IE (IE only generates onkeypress for ascii keys).

If you return true from the event handler, it means you are consuming the event
and thus cancelling the default action.

For example:

onkeydown="return event.keyCode != 13 || doSomething();"

More docs here (although I think the checkbox example is out-dated):
http://www.mozilla.org/access/keyboard/tabindex

Does that help? I'm 90% sure it will work, but haven't tried it with ALT+ keys.

Comment 3

14 years ago
No response from reporter, marking WFM.  Please reopen if Aaron's suggested fix
doesn't work for you.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → WORKSFORME
Summary: Audio Cue when hot key does not exist → No way for page to disable audio cue when browser does not recognize shortcut
You need to log in before you can comment on or make changes to this bug.