DannyJ Posted July 22, 2019 Share Posted July 22, 2019 Hi, I wanna make a simple program if I pressed the 'D' key here, the program sends me information about that: #include <GUIConstants.au3> #include <MsgBoxConstants.au3> #include <TrayConstants.au3> #include <Misc.au3> #include <GUIConstants.au3> #include <MsgBoxConstants.au3> #include <TrayConstants.au3> #include <Misc.au3> $button = InputBox("abc" ,"Write","") If _IsPressed("44") Then MsgBox(0,'a',"Press x key") ConsoleWrite("X") EndIf Thank you in adance your help Link to comment Share on other sites More sharing options...
Developers Jos Posted July 22, 2019 Developers Share Posted July 22, 2019 1 minute ago, DannyJ said: Thank you in adance your help Help on what as you haven't described what your problem is? Guess the program ends right away as you have no loop in there? Jos DannyJ 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DannyJ Posted July 22, 2019 Author Share Posted July 22, 2019 34 minutes ago, Jos said: Help on what as you haven't described what your problem is? Guess the program ends right away as you have no loop in there? Jos My problem is that when I press the button no MsgBox appears. For example, I wanna make a button with: Press D to continue. If it is pressed MsgBox appears . Link to comment Share on other sites More sharing options...
Developers Jos Posted July 22, 2019 Developers Share Posted July 22, 2019 As I said: I do not think the program is running when you press the button...right? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DannyJ Posted July 23, 2019 Author Share Posted July 23, 2019 16 hours ago, Jos said: As I said: I do not think the program is running when you press the button...right? Yeah you are right. How to make it run? Link to comment Share on other sites More sharing options...
Developers Jos Posted July 23, 2019 Developers Share Posted July 23, 2019 1 minute ago, DannyJ said: How to make it run? What do you mean by this question? I assume you know how to Run a script .... right? Just add logic in the script to keep it running and do this by adding a loop ..... something like While...Wend (check in the helpfile.) Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 23, 2019 Share Posted July 23, 2019 (edited) I'll feed you the fish 🙂 #include <Misc.au3> #include <MsgBoxConstants.au3> ;Opt("SendKeyDelay", 0) Local $hDLL = DllOpen("user32.dll") While 1 If _IsPressed("44", $hDLL) Then MsgBox(0,'a',"Press x key") ExitLoop EndIf Sleep(25) WEnd DllClose($hDLL) Edited July 23, 2019 by Xenobiologist DannyJ 1 Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now