#1
|
|||
|
|||
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. |
#2
|
|||
|
|||
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 |
#3
|
|||
|
|||
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? |
#4
|
|||
|
|||
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 |
#5
|
|||
|
|||
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. |
#6
|
|||
|
|||
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 |
#7
|
|||
|
|||
Hi Jjh,
sorry to say this, this solution doesn't working Could you please suggest me any other solution Regards Venkata |
#8
|
|||
|
|||
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 |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|