Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > General

Reply
 
Thread Tools Display Modes
  #1  
Old 05-24-2017, 12:57 PM
vensas3181 vensas3181 is offline
Registered User
 
Join Date: May 2017
Posts: 11
Enter, Control + Keys, function Keys & All key strokes

Hi ,

While I am trying to create vbscript I need to try different combination and/or individual key's needs to use from key board. Could you please let me know key stroke along with associated parameter need to use in vbscripting.

For example ,

Enter = Chr(13)

Like above I need to all references for all kind of key strokes.
Reply With Quote
  #2  
Old 05-24-2017, 01:52 PM
jjh jjh is offline
VanDyke Customer Support
 
Join Date: Feb 2004
Posts: 819
Hi vensas3181.

Thank you for contacting us. Probably, the easiest thing for you to do would be to use the "SendKeys" method in the Screen Object. If you look at the Scripting \ SendKeys Keystroke Table category of the SecureCRT Help documentation, you can see a list of the key strokes that you can send that way. In the Script Objects reference you can see information about the Screen Object and the SendKeys method.

Does this look like it will help you?

Thanks

JJH
Reply With Quote
  #3  
Old 05-24-2017, 02:30 PM
vensas3181 vensas3181 is offline
Registered User
 
Join Date: May 2017
Posts: 11
Hi Thanks for the info it helped.

I have scenario like below,

I need to use RightArrow {Right} for 11 times and press enter on 11 th time when cursor highlights the my option after 11 rightarrow key stoke.

Could you please let me know how to write this?
Reply With Quote
  #4  
Old 05-24-2017, 05:26 PM
jjh jjh is offline
VanDyke Customer Support
 
Join Date: Feb 2004
Posts: 819
Here are three different ways you could do what you are talking about:

Option #1: For..Next Loop

' Send 11 {Right} key-presses:
For i = 1 to 11
crt.Screen.SendKeys "{Right}"
Next

' Send {Enter} keypress
crt.Screen.SendKeys "{Enter}"

==============================

Option #2: Tell SendKeys how many:

crt.Screen.SendKeys "{Right 11}"
crt.Screen.SendKeys "{Enter}"

==============================

Option #3: W/in same SendKeys statement

crt.Screen.SendKeys "{Right 11}{Enter}"

Will one of these work better for you than the others?

JJH
Reply With Quote
  #5  
Old 05-25-2017, 03:07 PM
vensas3181 vensas3181 is offline
Registered User
 
Join Date: May 2017
Posts: 11
can I use like this?

crt.Screen.SendKeys "{RIGHT 1}"
crt.Screen.Send chr(13)
or

crt.Screen.SendKeys "{RIGHT 11}"
crt.Screen.Send chr(13)

I have used below option as per above suggestion.
crt.Screen.SendKeys "{RIGHT 1}"
crt.Screen.SendKeys "{Enter}"
But it is not working

My Screen bottom lines options are as follows where I want to select "Foli" and click enter so that it will open other screen.

Ed Foli GSR HSKPNG Shr RmTr ChgHst More Home

Last edited by vensas3181; 05-25-2017 at 03:25 PM.
Reply With Quote
  #6  
Old 05-25-2017, 06:15 PM
jjh jjh is offline
VanDyke Customer Support
 
Join Date: Feb 2004
Posts: 819
Hi vensas.

The "{RIGHT 1}" simulates pressing the right arrow one time, whereas the "{RIGHT 11}" simulates pressing it eleven times. driving an application menu can be complicated because you probably have to contend with some timing issues. It could be that your script "presses" the right arrow key before the screen has finished being painted, so your key presses are being lost. You might have to do something like a crt.sleep for a certain amount of time before you sent the arrow key.

Does doing a crt.sleep for a bit to give the menu some time to be painted help the situation?

JJH
Reply With Quote
  #7  
Old 05-26-2017, 10:05 AM
vensas3181 vensas3181 is offline
Registered User
 
Join Date: May 2017
Posts: 11
Hi Jjh,

sorry to say this, this solution doesn't working
Could you please suggest me any other solution

Regards
Venkata
Reply With Quote
  #8  
Old 05-30-2017, 11:10 AM
jjh jjh is offline
VanDyke Customer Support
 
Join Date: Feb 2004
Posts: 819
Hi Venkata.

I'll need more information to try to figure out what, exactly, isn't working. I think that this might be a good time to move this issue to e-mail. I'd like you to send a message referencing this forum thread to support@vandyke.com. I would like you to include a copy of your script as well as a raw log of your session. It sounds like you are trying to drive the navigation of a menu system, so I think a raw log would help us to see what is going on.

When you are manually navigating the menu, do you really use the right arrow key to move to the right or do you move to the right using the Tab key?

Thank you.

JJH
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 04:34 AM.