spuuunit

CTRL stuck after Send

4 posts in this topic

#1 ·  Posted

This is what I'm trying to do: In Firefox, if you hold down CTRL + C for about 200ms, then press CTRL + T. This is my code:

While WinActive(" - Mozilla Firefox")
        If _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Then
            $timer = TimerInit()
            While _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL)
                Sleep(10)
                $diff = TimerDiff($timer)
                If $diff > 200 Then
                    Send("^{T}")
                    While _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL)
                        Sleep(10)
                    WEnd
                EndIf
            WEnd
        EndIf
    WEnd

The problem is that the CTRL key gets stuck down after Send("^{T}"). I found this, but what I understand that happens when I release, and that is not what I want. The "General unstuck method" did nothing.

Share this post


Link to post
Share on other sites



#3 ·  Posted

That was the link in my post. That happens when I release, and that is not what I want. I want it to trigger after I have had it down for 200ms (and maybe still is down).

Share this post


Link to post
Share on other sites

#4 ·  Posted

Nobody who knows if this is possible?

Share this post


Link to post
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

  • Similar Content

    • Baboo85
      By Baboo85
      Hi all,
      I need to start a script that include:
      - admin privileges
      - multiple cmd commands
      - no bat, no exe, no tmp files created anywhere (especially in the user temp folder)
      In a bat file it would be simple, but users shouldn't see what commands I'm sending.
      Example of the script:
      echo off cls echo. echo I AM A TOOL echo. echo NOTE: echo - note 1 echo - note 2 echo - etc set USER1=0 set COMPUTER1=0 if /i %username% equ user.user ( set USER1=1 set COMPUTER1=1 ) if /i %username% equ another.user set USER1=1 if /i %computername% equ notebook set COMPUTER1=1 if %USER1% EQU 1 ( if %COMPUTER1% EQU 1 ( reg delete "HKLM\SOFTWARE\blablabla" /f ) else ( echo Computer not authorized. Contact assistance.) ) else ( echo User not authorized. Contact assistance.) echo. pause exit With the send("") is a disaster.
      I'm a noob here, so what can I do?
       
      EDIT: OR ELSE I explain the situation and what I need, so if there is a simple solution I can use that.
       
      SITUATION: our domain users have Users rights on the machine. Some of them need administrator rights.
      We create a local user with administrator rights, so that the users must insert username and password when asked to run something with administrator rights.
      We have an internal domain group policy that blocks EXE, BAT, COM, TMP files from the user local temp directory, for a security reason (malware). That also blocks most software installation.
      But some users are often out of office, away from workplace and in another country, they need a complete control on their computers.
       
      WHAT I NEED: I need to check the username and the computer name. If the username is the one with local administrator rights and the computer name is a computer that is qualified to temporary remove the policy, then I need to execute a REG DELETE command with administrator rights.
       
      I hope I explained myself.
       
      Thank you very much.
    • Jefrey
      By Jefrey
      I've made this HTTP lib to simplify HTTP requests, mainly when dealing about POST data or file uploads.
      Three functions are available:
      string _HTTP_Get ( string $sURL ) string _HTTP_Post ( string $sURL , string $sPostData ) string _HTTP_Upload ( string $sURL , string $sFilePath , string $sFileField , string $sPostData = '' , string $sFilename = Default) Additionaly, two helper functions are also available:
      URLEncode($sStr) URLDecode($sStr) Full documentation: https://github.com/jesobreira/HTTP.au3/blob/master/README.md
      Fork me on Github: https://github.com/jesobreira/HTTP.au3
      Download lib + docs: https://github.com/jesobreira/HTTP.au3/archive/master.zip
    • caramen
      By caramen
      Hello guys.
      I have got this script
      $iPid = run("Powershell Get-ADUser "&$UserNameReaded&" -Properties * | select -Expand EmailAddress" , @WindowsDir , @SW_HIDE , 0x2) $MailUser = "" While 1 $MailUser &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd GUICtrlSetData ($Label015, ""&$MailUser) If $MailUser = "" Then GUICtrlSetData ($Label017 , "N/A"&$MailUser) Everything is working fine i got correct value
      For my account the value is for exemple :
      J.Personnal@Enterprise.com in the $Label017 the value is correct i have still
      J.Personnal@Enterprise.com If i use :
      Send (""&$MailUser) i have now :
      J.Personnalnterprise.com Is there a way to correct this ?
    • darkangel37
      By darkangel37
      hello im trying to automate random greetings word from .txt file  and write/send some strings but it gives me error
      please be gentle to me im kinda newbie thank you
      $File = FileReadToArray("words.txt") $RandomWords = $File[Random(0, UBound($File) - 1, 1)] send ("$RandomWords") sleep (1000) send ("{enter}")
       
    • ruslanas402
      By ruslanas402
      Greeting, so I've been trying to come up with solution, but no luck. Despite I tried to automate upload function, I released that it freezes after "Choose File to Upload" window appears..
       
      #include <IE.au3> ;#include <_Dbug.au3> Global $oIE = _IECreate("http://tinypic.com/", 1) Global $upload2 = _IEGetObjById($oIE, "the_file") _IEAction($upload2, "click") ;Sleep(1000) $hWnd = WinGetHandle("Choose File to Upload") MsgBox(0, "", $hWnd) Have anybody faced this situation?
      btw: srry for the advertise Besides it's no matter which site I'm trying to do this it's all the same.