Our vBulletin migration is complete.
Welcome vBulletin users! All content and user information from the Micro Focus Forums (vBulletin) site has been migrated to this site. READ MORE.
kefka95 Absent Member.
Absent Member.
1333 views

Using SendKeys for control keys

We have a lot of legacy EXTRA Basic code that uses the SendKeys method to send control keys to the screen. For example:

SendKeys("<PF3>")
SendKeys("SomeValue<ENTER><PF9>")
SendKeys("<CLEAR>")


In the Reflection API, it appears that the SendKeys method simply passes the literal string to the screen rather than executing the control key. Is there any way to make this work similar to EXTRA Basic, or do we just have to update our code to use the new SendControlKey method?
0 Likes
2 Replies
vfast Absent Member.
Absent Member.

Re: Using SendKeys for control keys

If you are converting code to use the Reflection API, you will need to use the separate "SendControlKey" method to send enter and other "AID" keys. In the previous versions of Reflection (14.1 and earlier), these were also separate functions ("Transmit" and "TransmitTerminalKey"), and the new version of the Reflection API is consistent with the old version of Reflection, not Extra!.

Your old Extra! Basic code should still work as-is with Reflection, since backwards-compatibility for this is provided by Reflection Desktop. So you shouldn't need to update anything unless you want to change something. Of course, new macros or other scripts should use the new Reflection API, which provides extensive control over all aspects of the product.
0 Likes
kefka95 Absent Member.
Absent Member.

Re: Using SendKeys for control keys

Thanks, that's what I suspected. I forgot to mention that this is .NET code, where the backwards compatibility doesn't seem to work as well.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.