Look_Up Posted August 22, 2017 Report Share Posted August 22, 2017 Hello. I want create a macro which is waiting not only for one keys rather two. If you chose A key goto "x". If i chose E key goto "y". Currently Macro Express don't support waiting for 'x' OR 'y' key. Can somebody help me with a workaround ? Here is an example from my idea (careful it is not working !) MessageBox: Info Delay: 1 seconds Wait for Key Press: A OR Wait for Key Press: E // evaluation Switch( %keystroke% ) Case: A // do something useful End Case Case: E // write some text End Case End Switch ------------------------------------------------------------------------------------------------------------------- <MESSAGEBOX Caption="Info" Message="After clicking on OK the macro waiting for keypress 'A' or keypress 'E'" Icon="0"/> <DELAY Flags="\x01" Time="1"/> <WAIT FOR KEY PRESS Key="A" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <OR/> <WAIT FOR KEY PRESS Key="E" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <COMMENT Value="evaluation"/> <SWITCH Variable="%keystroke%"/> <CASE Value="A"/> <COMMENT Value="do something useful"/> <END CASE/> <CASE Value="E"/> <COMMENT Value="write some text"/> <END CASE/> <END SWITCH/> I appreciate every working idea Quote Link to comment Share on other sites More sharing options...
rberq Posted August 22, 2017 Report Share Posted August 22, 2017 Since you are using a message box, could you instead use the "Multiple Choice Menu" Dialog? I do have a possible solution for the situation you as presented it, but it is way more complicated -- have your primary macro start two other concurrent macros, one that waits for A and one that waits for E, and code a Repeat loop in the primary macro waiting for a signal from either one of the waiting macros. You can wait for "Any key" to be pressed. It's too bad Macro Express doesn't insert the pressed key into a text variable -- then you could check whether it is A or E and re-issue the wait if not. Quote Link to comment Share on other sites More sharing options...
paul Posted August 22, 2017 Report Share Posted August 22, 2017 Here's an idea I wrote about several years ago which may, or may not, be helpful <g>! It's quite complex! It is possible to write a total of 39 macros (one for each character and number, plus 3 control macros) which are fired according to which key has been pressed. Thus, pressing 3 intiates macro-3, pressing h initiates macro-h. It involves writing a total of 39 macros (most of which are almost identical)! See Detecting Keys pressed for details. But this works only in ME4. Quote Link to comment Share on other sites More sharing options...
Cory Posted September 19, 2017 Report Share Posted September 19, 2017 Not much time to comment but waiting for for an unknown key is not something MEP does. Look in the forum and you will find dozens of times people have wanted this but it wasn't available. It's best to think of another way to do what you need. Paul has probably the most reasonable solution and to my way of thinking that's too complicated. Quote Link to comment Share on other sites More sharing options...
Look_Up Posted September 20, 2017 Author Report Share Posted September 20, 2017 Yea i forgot to answer this thread. Thank you to rberg & paul. I think paul's solution is the best one. Hopeful the Macro Express Pro developer read this thread and bring out an usefull update in future. Quote Link to comment Share on other sites More sharing options...
Cory Posted September 20, 2017 Report Share Posted September 20, 2017 You might consider making a feature request on their website. I've been thinking of creating a generic .NET webform that a macro could define. Mainly people want to have multiple text fields. In my vision there my program would take text file as a command line parameter. Each line of the text file would create the form controls in a simplified way. EG text boxes, buttons, radio buttons, check boxes. Look in my posts for my offer. I could see creating a 'wait for key press' control. However no one seems interested in it so I can't justify spending the time to make what could be a very useful add-in. I would also like to make add-ins for RegEx, Web tasks and other functions MEP doesn't have. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.