Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > Scripting & Automation
  New Posts New Posts RSS Feed - Output Arrow Keys
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedOutput Arrow Keys

 Post Reply Post Reply
Author
Message
kbdav View Drop Down
Newbie
Newbie


Joined: July 12 2016
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote kbdav Quote  Post ReplyReply Direct Link To This Post Topic: Output Arrow Keys
    Posted: July 12 2016 at 8:03pm
I have recorded a macro using AccuTerm 2k2 (emulating VT420 terminal). I had to modify the script a bit as it didn't pick up the `.SetSelection` because it didn't record my selection interestingly enough. However, this is not the issue at hand. I have searched for a week now for a solution on how I can output arrow keys correctly.

The issue is when I recorded the Macro, it recorded the left arrow key as ^[[D, which was somewhat expected. However, during the macro replay it takes that code literally and types that in instead of arrowing left. Here is the line of code that is keeping this entire macro unusable:

.Output " PG" & "^[[D" & "^[[D" & "^[[D"
.SetSelection 11,9,22,9
.Copy
.Paste ""

Here is the issue, I am needing to type PG first (preceded by a single space), arrow left 3x, then paste my selection. Instead of arrowing left, the Macro literally types "^[[D" instead.

I have tried this: .Output " PG" & Chr$(27) & Chr$(27) & Chr$(27)
still without success.. The solution that keeps coming to mind is one that is similar to VBA's "SendKeys", is there a similar command to SendKeys in AccuTerm's code library? Is there any other alternative? Should I even be using .Output for arrow keys?

I appreciate any assistance provided! *would appreciate the character codes for ALL arrow keys for my reference in the future!
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (1) Thanks(1)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: July 13 2016 at 4:04pm
Hello Keith -

I think the macro recorder in 2K2 may be the problem. I tested a similar case using AccuTerm 7, and the cursor keys were recorded as
.Output ChrW$(27) & "[A"
which is correct for VT emulations. You might be able to edit your macro so that it looks like
.Output " PG" & Chr$(27) & "[D" & Chr$(27) & "[D" & Chr$(27) & "[D"


Maybe its time to upgrade to AccuTerm 7?

Thanks,

Pete

Back to Top
kbdav View Drop Down
Newbie
Newbie


Joined: July 12 2016
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote kbdav Quote  Post ReplyReply Direct Link To This Post Posted: July 14 2016 at 11:25am
Excellent! That did the trick - Thanks for your input! Thumbs Up
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.