...

View Full Version : turnoff firefox find on keydown



wac
12-27-2005, 04:28 PM
I'm trying to do an onkeydown in firefox but the keys keep getting used by the 'find' feature of fire fox. How do I turn this feature off so my keydown handler will get called???

nikkiH
12-27-2005, 05:17 PM
For yourself? It's in about:config, filter by "find". There's a few settings.
For others? You don't.

felgall
12-27-2005, 08:33 PM
The browser settings always take priority over web page settings.

wac
12-28-2005, 03:37 AM
how does one manipulate these configurations ?

wac
12-28-2005, 03:48 AM
well,
after setting 'accessibility:typeaheadfind' back to the default (false), I still cannot get the following code to work in firefox. This code simply displays the keypress/keyup/keydown codes in the table. This works fine on IE, but does nothing on firefox. Please help


<html>
<head>
<title>Test key presses</title>
<script type="text/javascript" src="../scripts/utils.js" ></script>
<script type='text/javascript'>
function keypress(event)
{
var code = getEventKeyCode(event) ;
var elem = document.getElementById('keypress') ;
elem.innerHTML = ''+code ;
}

function keydown(event)
{
var code = getEventKeyCode(event) ;
var elem = document.getElementById('keydown') ;
elem.innerHTML = ''+code ;
}
function keyup(event)
{
var code = getEventKeyCode(event) ;
var elem = document.getElementById('keyup') ;
elem.innerHTML = ''+code ;
}
</script>
</head>
<body>
<div style='border-style:outset;border-width:3;width:150;height:150'
onkeypress='keypress(event)'
onkeydown='keydown(event)'
onkeyup='keyup(event)'
>

<table >
<tr><td>Key Pressed:</td><td id='keypress'></td></tr>
<tr><td>Key Down:</td><td id='keydown'></td></tr>
<tr><td>Key Up:</td><td id='keyup'></td></tr>
</table>
</div>
</body>

</html>

gboudreau
09-23-2006, 03:58 PM
I'm trying to do an onkeydown in firefox but the keys keep getting used by the 'find' feature of fire fox. How do I turn this feature off so my keydown handler will get called???

Here's how I was able to do it:

var stopDefaults = false;
function keyDown(e) {
// alert(e.keyCode);
switch(e.keyCode) {
case 74: scrollDn(); stopDefaults = true; break;
case 75: scrollUp(); stopDefaults = true; break;
default: stopDefaults = false; break;
}
}
function keyPress(e) {
if (stopDefaults) {
e.preventDefault();
}
}
window.document.addEventListener("keydown", keyDown, true);
window.document.addEventListener("keypress", keyPress, true);
- Guillaume Boudreau



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum