Ok, I have programmed in c++ for a while, but recently, I have found an emulator that supports vbscript files and have some questions about it.

What I need to do, is detect a keystroke with the vbscript. How does one go about detecting a keypress with a vbscript, while an emulator is busy running a rom. I then need to send a series of keystrokes to the emulator, such that it thinks they were pressed by the user. Is all of this possible with a vbscript file? Do I need to do my chore with an actual language.

Also, if all of this is possible, how do I make it so that the vbscript doesnt use crazy amounts of cpu. I need it to be active enough to catch the keypress, but that is all. Is there a way to set up an onEvent with a keypress. Mind you though, this isnt a script running in Internet Explorer, it is being processed by an emulator, which does have support for any standard vbscript, along with its own little library of functions.

Thank you much.

Not unless the emulator has an API or Object that you can use to hook keystrokes. On it's own, it doesn't offer keyhook abilities. For that, you'll need a full-fledged language. I suppose it would be possible to make some kind of keyhook class, and use createobject within the VBScript to instantiate an instance of a keyhook object, but you'll have to do all the keyhook work from a full language.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.