...

View Full Version : detecting a keystroke?



djonatan
08-29-2007, 08:27 AM
so considering i know nothing about programming, could this be done in vbscript?
would it be like pages of typing or is it simple

Philip M
08-29-2007, 09:39 AM
I expect it can be done in VBscript, but a simple JavaScript is

<SCRIPT type = "text/javascript">
document.onkeydown = function(ev) {
var key;
ev = ev || event;
key = ev.keyCode;
alert (key);
}
</SCRIPT>

oracleguy
08-29-2007, 05:19 PM
I expect it can be done in VBscript, but a simple JavaScript is

<SCRIPT type = "text/javascript">
document.onkeydown = function(ev) {
var key;
ev = ev || event;
key = ev.keyCode;
alert (key);
}
</SCRIPT>

Considering we are in the computer programming forum (assuming it wasn't moved here) I'd assume the OP was refering to VBScripts executing outside of a web browser.

sage45
08-29-2007, 05:51 PM
You could do it, you would just have to use the WSH in order to load the VBScript. But then you would want it to run in the background which would require a timer that would recycle and detect a keystroke, then take the appropriate action(s).

-saige-



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum