Jump to content

A truly noob question


 Share

Recommended Posts

Greetings, I am new to coding and have recently decided to try out AutoIt in my search to imbue my keyboard with the option for "tubo buttons". With what I've learned so far I've managed to write a program with a toggleable on and off button. I'll link the program here just in the offchance anyone is interested

HotKeySet("{PAUSE}", "PausePushed")
HotKeySet("{HOME}", "EndScript")

$Boolean1 = False

Func MainLoop()
While 1
While $Boolean1 = True
Send("{SPACE}")
Sleep(Int(Random(30, 36)))
Send("{8}")
Sleep(Int(Random(30, 36)))
Send("{7}")
Sleep(Int(Random(30, 36)))
WEnd
Sleep(100)
WEnd
EndFunc

; Function to toggle on and off
Func PausePushed()
    $Boolean1 = Not $Boolean1
    MainLoop()
EndFunc

MainLoop()

; Function to exit script
Func EndScript()
Exit
EndFunc

I was wondering if there was a way to detect is a button is pressed and a seperate way to detect when that button is realsed or a way to check if a button is held down. I was unable to locate any functions like this in the online documentation.

Thank you for your time reading this.

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...