Alright, I have perhaps a bit of a toughie for my...second ever StackOverflow question. Below is a hefty bit of background on my issue. Here is the TLDR: can I, using native Javascript, ActiveX objects, and through that PowerShell, capture keyboard input without popping up a window or using HTML?
BACKGROUND - I'm working in a specific game engine. Said game engine uses ES3, with apparently a few features of ES5 tacked on such as array.indexOf()
, for plugin development. It's really not pretty, but recently some folks and I discovered we can still create ActiveXObjects, run powershell through that, and so forth. Through this, we're managing all kinds of things - the next step is, hopefully, to capture keyboard input.
Natively, the engine - SRPG Studio - can only detect a limited number of inputs, assigned starting at -1 for nothing, -2 for mouse, and 0 through 11 for Left, Up, Right, Down, and various other keys that are assignable in a config file once you export a game or demo. You cannot, natively, detect other keys - they use a hidden "root" command, root.isInputState()
, which returns true or false if the value is from 0 to 11, and always returns true if it's higher, or always false if it's lower. I cannot see the code of the function itself, but I have tested various numbers, to the point of crashing the Test Play feature by inputting a number that is too large for it to parse - 30501850151. At random keypresses.
That was all background, and I apologize for how much there is. The question is as follows:
Can I detect and capture keyboard input using ActiveX or Powershell, using a method that will not require jQuery, NodeJs, or in fact any such additional modifications, as well as not using HTML, as the engine reads it as bad syntax? It would aid us in creating a communications interface for a recently developed PvP plugin.
Thank you for your time.