Jump to content

Recommended Posts

Posted

Good!

I'm making one script to press one key (PAUSE) and it stays pressing and releasing mouse left click.
But i want to press F1 and a tooltip shows up: "Please select the Key". And after that, instead PAUSE sends left mouse clicks, it send the key the user pressed on keyboard. Better if it detects multiples key too.

I've:

#include<IE.au3>
#include <Misc.au3>


HotKeySet("{ESC}" , "close")
HotKeySet("{PAUSE}" , "startpause")
HotKeySet("{F1}" , "mapkey")

Dim $click = False
Dim $keymapped = Null
Dim $mousekey = True

$dll = DllOpen("user32.dll")

Func close()
    Exit
EndFunc

Func startpause()
   $click = Not $click
EndFunc

Func mapkey()
    $keymapped = GET HERE KEY THAT USER PRESSED!
EndFunc


While 1
    If $click = True Then
        If $mousekey = True Then
            MouseClick("left")
        EndIf
        If $mousekey = False And $keymapped Not Null Then
            Send($keymapped)
        EndIf
        Sleep(50)
    EndIf
    sleep(20)
WEnd


Could anyone help me creating this, please?

Thank you!
 

  • Moderators
Posted

JoewAlabel,

Welcome to the AutoIt forums.

Before going any further I suggest you read this announcement - detecting any key pressed is a bit of a no-no around here.

M23

 

 

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

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted
  On 11/1/2019 at 9:09 PM, Melba23 said:

JoewAlabel,

Welcome to the AutoIt forums.

Before going any further I suggest you read this announcement - detecting any key pressed is a bit of a no-no around here.

M23

 

 

Expand  

Thank you!

I read, but as I posted, i need just to map the key to send it infinite till users press PAUSE key. 

Its a better Autoclicker, but instead of just left mouse button clicks i want the user set the key they want after pressed "F1". ;)
 

  • Moderators
Posted

@JoewAlabel you have been pointed to the forum rules twice now. Why don't you explain just what you're trying to accomplish. 

 

                                                               ===In case you missed it, this is a Mod stepping into a thread===

 

 

"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!

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
  • Recently Browsing   0 members

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