Jump to content

Remap Pause Key to Another Function?


 Share

Recommended Posts

Hello user2037,

First, Welcome to the AutoIt Forums ;)

Would HotKeySet() work for what your trying to do?

Global $Paused
HotKeySet("{HOME}", "TogglePause") ; Will pause your script if the 'Home' is pressed,
HotKeySet("{ESC}", "Terminate")
HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d

;;;; Body of program would go here ;;;;
While 1
 Sleep(100)
WEnd
;;;;;;;;

Func TogglePause()
 $Paused = NOT $Paused
 While $Paused
 sleep(100)
 ToolTip('Script is "Paused"',0,0)
 WEnd
 ToolTip("")
EndFunc

Func Terminate()
 Exit 0
EndFunc

Func ShowMessage()
 MsgBox(4096,"","This is a message.")
EndFunc

As you can see with the other HotKey's there are multiple ways to run a function from a HotKey or HotKey combination. There is also _IsPressed(), although I generaly prefer HotkeySet() since its more Global.

My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. 

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