milov.nl

Interaction design • webdevelopment • web art • photography

milov.nl : forum : coding : 'javascript: capturing ctrl-left click'

javascript: capturing ctrl-left click gmail.com,bricollins,brianc, 060106 19:08
is there any cross-browser way of capturing a control click on an image?
62-31-71-96.cable.ubr08.newt.blueyonder.co.uk
Re: javascript: capturing ctrl-left click gmail.com,bricollins,brianc, 060107 14:56
I've found it, in case anyone's wondering:


if (parseInt(navigator.appVersion) > 3) {
document.onmousedown = mouseDown;
if (navigator.appName == "Netscape")
document.captureEvents(Event.MOUSEDOWN);
}

function mouseDown(e)
{
if (parseInt(navigator.appVersion) > 3)
{
var evt = (navigator.appName == "Netscape" ? e : window.event);

shiftPressed = evt.shiftKey;
altPressed = evt.altKey;
ctrlPressed = evt.ctrlKey;
}

return true;
}
 
62-31-71-96.cable.ubr08.newt.blueyonder.co.uk
Pages: 1