Jump to content

Send keys is not taking !


ur
 Share

Recommended Posts

If you observe in below code.

Func _WinWaitActivate($title,$text,$timeout=$time_out)
    Logging("Waiting for "&$title&":"&$text)
    $dHandle = WinWait($title,$text,$timeout)
    if not ($dHandle = 0) then
        If Not WinActive($title,$text) Then WinActivate($title,$text)
        WinWaitActive($title,$text,$timeout)
    Else
        Logging("Timeout occured while waiting for the window...")
        Exit
    EndIf
EndFunc


WinActivate("Untitled - Notepad")
$p = "Notallowed1!!"
Send("{ENTER}{ENTER}{ENTER}{ENTER}"& $p &"{ENTER}create{SPACE}database{SPACE}"& $p &";{ENTER}")

In the notepad if you observe, ! is missing in the text got.

 

Is there way to get that also printed.

Link to comment
Share on other sites

  • Moderators

@ur Dog ate your help file? Look at Send, there is a flag to send the raw keys; otherwise when you send a ! you're telling AutoIt to hit ALT.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

So you have to mask ! (which means "ALT")  with {!}.

WinActivate("Unbenannt - Editor")
Local $p = 'Notallowed1{!}'
Send("{ENTER}{ENTER}{ENTER}{ENTER}"& $p &"{ENTER}create{SPACE}database{SPACE}"& $p &";{ENTER}")

Func _WinWaitActivate($title,$text,$timeout= 5)
    Local $dHandle = WinWait($title,$text,$timeout)
    if not ($dHandle = 0) then
        If Not WinActive($title,$text) Then WinActivate($title,$text)
        WinWaitActive($title,$text,$timeout)
    Else
        Exit
    EndIf
EndFunc

Conrad

SciTE4AutoIt = 3.7.3.0   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win_10   Build = 19044   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE     H:\...\AutoIt3      H:\...\AutoIt3\Include     (H:\ = Network Drive)

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Link to comment
Share on other sites

22 hours ago, JLogan3o13 said:

@ur Dog ate your help file? Look at Send, there is a flag to send the raw keys; otherwise when you send a ! you're telling AutoIt to hit ALT.

THanks for your input Logan.

 

But the output will be as below.
{ENTER}{ENTER}{ENTER}{ENTER}Notallowed1!{ENTER}create{SPACE}database{SPACE}Notallowed1!;{ENTER}

Even the {ENTER} will be interpreted as rawkeys.

My question :

Is there anyway to send !. I mean only exclamation mark.

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

×
×
  • Create New...