Display message by pressing key
Posted: 27 Dec 2019, 17:52
I am trying to make that when pressing a key a message is issued, example "Macro Enabled", but only the smallest alert possible on the screen, no button to click and etc., only appears when pressing the key and disappears after 3 seconds. I tried some things with the help of the forum, but this is where my problems begin.
First: In my code so far the message appears only with a button and I do not want any button just a small message on the screen.
Second: I will use 3 keys and when I switch between one button and another sometimes I have to press 2 times each button for the message to appear.
Can someone help me?
I am adding the code for analysis.
First: In my code so far the message appears only with a button and I do not want any button just a small message on the screen.
Second: I will use 3 keys and when I switch between one button and another sometimes I have to press 2 times each button for the message to appear.
Can someone help me?
I am adding the code for analysis.
Code: Select all
#NoEnv
SendMode Input
~1 Up::Suspend, OFF
~2 Up::Suspend, ON
~G Up::Suspend, ON
!1 Up::Suspend, OFF
!2 Up::Suspend, ON
;~Tab Up::Suspend, ON
;~WheelDown::Suspend, Off
;~WheelUp::Suspend, On
1::
SetTimer, Macro, -100
MsgBox,, macro, is Active, 2
Return
2::
SetTimer, Macro, -100
MsgBox,, macro, is Disabled, 2
Return
G::
SetTimer, Macro, -100
MsgBox,, macro, is Disabled, 2
Return
Macro:
Loop, 4
{
SoundPlay, *-1
Sleep, 1000
}
Return