Jump to content
Sign in to follow this  

Hotkey not working

Recommended Posts



• Save color of pixel at center

• Compare a constantly updated pixel with original pixel

• Print message if original pixel is different than new one

• Exit when hotkey is pressed


• Hot keys have no effect

• It doesn't even read the first msg box from firing the hotkey for "fire"

#include <Misc.au3>
#include <MsgBoxConstants.au3>
$toggle = 1
$start = 1
HotKeySet ( "F7" , "fire" )
HotKeySet ( "F8", "On_Exit" )
While True
Func fire()

   MsgBox($MB_SYSTEMMODAL, "success", "yay", 3)
   $color = PixelGetColor(@DesktopWidth / 2, @DesktopHeight / 2)

   While True
       $color1 = PixelGetColor(@DesktopWidth / 2, @DesktopHeight / 2)

       If Not $color == $color1 Then
         MsgBox($MB_SYSTEMMODAL, "yay", "yay", 3)



Func On_Exit()
Edited by Knee

Share this post

Link to post
Share on other sites


The format of the key is wrong for HotKeySet...see Helpfile

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post

Link to post
Share on other sites

I've looked at the help file and some examples and they all use the same format

i.e. HotKeySet ( hotkey , function name )

Else, I'm not sure what you mean.

I've checked with other keys, they work, just not the function keys.



aha, now I see it,

F7 ---> f+7 (i think)

instead of using

{F7} ---> {F7}

Edited by Knee

Share this post

Link to post
Share on other sites


Please read the comment I made in your >other thread. :naughty:


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Share this post

Link to post
Share on other sites
This topic is now closed to further replies.
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.