Jump to content

Force a carriage return after <n> keystrokes


Recommended Posts

I have been pondering how to accomplish a forced carriage return in a terminal app (teraterm) that would countdown from 32 with every keystroke.  I am kind of new at scripting and could use any help that you all could give. 

Link to comment
Share on other sites

Might fall under "capturing all keys" rule this, so you might be out of luck.

Here is some code to recognize when a key is pressed by Melba23.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $cKey_Pressed

_PressAnyKeyToContinue()

Func _PressAnyKeyToContinue()
    $hGui = GUICreate("Press any key...", 0, 0, -100, -10)
    $cKey_Pressed = GUICtrlCreateDummy()
    GUISetState()
    GUIRegisterMsg($WM_KEYUP, "_KeyPressed")
    ;$iBegin = TimerInit()
    Do
    Until GUIGetMsg() = $cKey_Pressed
EndFunc   ;==>_PressAnyKeyToContinue

Func _KeyPressed()
    GUICtrlSendToDummy($cKey_Pressed)
EndFunc   ;==>_KeyPressed

But I don't think it will help your case as the window has to be active.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...