Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: SV: catch CTRL events in IE


Message #1 by "Robert Nyman" <robert.nyman@c...> on Thu, 24 Oct 2002 15:32:25 +0200
How's your syntax?

This is how I'd do it:

document.onkeydown =3D function (){
	var intKeyCode =3D eevnt.keyCode;
	if(event.ctrlKey && intKeyCode =3D=3D 'The keycode for a'){
		// Do what you want
		event.cancelBubble =3D true;
		event.returnValue =3D false;
	}
}


/Robert


-----Ursprungligt meddelande-----
Fr=E5n: simon thompson [mailto:sse@c...]
Skickat: den 24 oktober 2002 13:31
Till: javascript
=C4mne: [javascript] catch CTRL events in IE


Hello, I wish to program keyboard shortcuts on my web page.  I can catch

the keyboard events fine.  I wish to use CTRL-A and CTRL-K, etc.  Even
after stopping bubbling and stopping the default action.  I can not stop

IE's CTRL sequences from working.  i.e. I can catch using the keyup
event
but it still selects everything on the screen.

Any idea ?

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20


  Return to Index