Forum Discussion
Not EXACTLY the answer to your question... but is there a reason why you can't just call "Keys([Enter])" on the control to send the enter command without having to directly access the event handler?
- dbattaglia9 years agoContributor
I can if I have to, but I was trying to follow the pattern we have established in the wrapper function.
Actually, if what I am asking about is not possible--due to language or technical limitations or what have you--then I will have to just code this script as a one-off. But that is what I am trying to avoid.
That said, this form is an oddity on its own, so perhaps the one-off wouldn't be so bad.
It would not be the worst thing, but I always try to maintain the patterns we have established.
Regardless, I am always looking for new and interesting things to learn.
Let me know if you have any suggestions.
- tristaanogre9 years agoEsteemed Contributor
A few years ago, I had to simulate a credit-card swipe using a magnetic swipe reader that was "wedged" between the keyboard and the PC. Basically, what the hardware did was convert the code in the magnetic swipe into keyboard events. The "Keys" method of TestComplete wasn't fast enough to do this so I had to build my own code to do this rapid swipe...
...unfortunately, that was about 14 years ago at a different company with a different code language... so I don't have it at my finger tips. The technology exists to do so but, my question that I would ask myself is, is it worth it to do something one way to "stick with a pattern" or do it an "easier" way to get the job done. This is not a question I can answer for you, but it's something to consider.
If I have time, I'll look around and see if I can rustle up that code. In the meantime, you can try using LLPlayer.KeyDown and LLPlayer.KeyUp... now, this is not VBScript code, but perhaps you can adapt it:LLPlayer.KeyDown(VK_RETURN, 10) LLPlayer.KeyUp(VK_RETURN, 10)
Another possible option - If you have the Win32API plug in installed, you basically have access to all options in that API, including keybd_event (see https://msdn.microsoft.com/en-us/library/windows/desktop/ms646304(v=vs.85).aspx).
So... other than using the Keys method, there are some potential options as well...