Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keyboard capture doesn't work until Venkman JS debugger launched!

Status
Not open for further replies.

ChantCd

Programmer
Aug 22, 2006
4
US
I have a web application (Javascript) that captures keyboard input.

The code works independently -- in fact, I've tried several different variations/code snippets that other people have used/recommended. They all work, and are functionally equivalent.

But here's the clincher -- my whole program works fine -- keyboard and all -- once I run Venkman's Javascript debugger and then return to my program window!

It's as if Venkman's is doing something (setup, initialization) that my program isn't.

What could it be though?

Thanks,

Matthew

Here is the keyboard portion of my program:

function keyboard_handler(e) {
e = e || window.event;
var keyunicode = e.charCode || e.keyCode
var KeyID = e.keyCode || e.which;

vDebugPrint("Keyboard pressed: " + KeyID);
vDebugPrint("Unicode: " + keyunicode);
}

document.onkeydown = keyboard_handler;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top