Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-04-2013, 07:58 PM
desertsea desertsea is offline
Registered User
 
Join Date: Mar 2013
Posts: 3
how to emulate "press space bar"

Hi all:

Our equipment need to "press space bar" to stop program:

--------------------------------------------------------------------------
TO RESET ALL CONFIG DATA TO DEFAULTS, boot w/ the development jumper in place,and remove the development jumper during the 10-second startup delay period.
To change any of this, press SPACE BAR within 10 seconds

I have tried follows:
crt.Screen.Send chr(32)
crt.Screen.Send " "

crt.screen.SendKeys chr(32)
crt.screen.SendKeys " "

Though I can see space appear, but it doesn't work

I also tried to map the SPACEBAR key as follow:
KeyCombination Function Argument
VK_SPACE SEND \040

But when I send:
crt.screen.SendKeys("{SPACE}") or
crt.screen.SendKeys("{SPACEBAR}")

The argument is invalide.

Can you help to check?

Thanks in advance.


Regards
Desertsea
Reply With Quote
  #2  
Old 03-05-2013, 10:37 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi Desertsea,

Thanks for the question. What protocol are you using to connect to the device?

What happens if you manually try to press the space bar?

What other programs are you able to use to connect to this device and successfully send a space to the remote?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #3  
Old 03-05-2013, 05:03 PM
desertsea desertsea is offline
Registered User
 
Join Date: Mar 2013
Posts: 3
Quote:
Originally Posted by rtb View Post
Hi Desertsea,

Thanks for the question. What protocol are you using to connect to the device?

What happens if you manually try to press the space bar?

What other programs are you able to use to connect to this device and successfully send a space to the remote?

Hi Todd:

Thanks for your quickly response.

I use "Telnet" to connect the device.

If I manually press the space bar. The reboot program will stop and I can do some setting. Otherwise it will continuely reboot.

I have used "Tera Term" to connect this device and successfully send space with follow command.

wait 'To change any of this, press SPACE BAR'
pause 2
sendkcode 57 1

Regards
Renqi
Reply With Quote
  #4  
Old 03-06-2013, 10:27 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi Renqi,

Thanks for the information. It seems like this might be a matter of timing. Does your script wait for an indication from the remote device that it is ready to receive the space that SecureCRT is sending?

If you are not using the Synchronous property, and the WaitForString() method, then SecureCRT may simply be sending the space too soon.

For example:
Code:
crt.Screen.Synchronous = True
crt.Screen.WaitForString "press SPACE BAR within 10 seconds"
crt.Screen.Send " "
Does this help to resolve the issue?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #5  
Old 03-06-2013, 05:26 PM
desertsea desertsea is offline
Registered User
 
Join Date: Mar 2013
Posts: 3
Quote:
Originally Posted by rtb View Post
Hi Renqi,

Thanks for the information. It seems like this might be a matter of timing. Does your script wait for an indication from the remote device that it is ready to receive the space that SecureCRT is sending?

If you are not using the Synchronous property, and the WaitForString() method, then SecureCRT may simply be sending the space too soon.

For example:
Code:
crt.Screen.Synchronous = True
crt.Screen.WaitForString "press SPACE BAR within 10 seconds"
crt.Screen.Send " "
Does this help to resolve the issue?


Hi Todd:

Thanks for your kindly help.
Actually, I have the Synchronous code in my scripts.
But you are right, it's one synchronous issue, after add two second delay time
this issue has been resloved.

crt.Screen.Synchronous = True
crt.Screen.WaitForString "press SPACE BAR within 10 seconds"
crt.sleep 2000
crt.Screen.Send " "

Thanks again
Renqi
Reply With Quote
  #6  
Old 03-07-2013, 07:50 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi Renqi,

Thanks for the update. I am glad to hear that this issue is resolved.
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
Reply


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

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 02:49 PM.