Page 1 of 1

MicroMacro open file dialog bug

Posted: Wed Feb 12, 2014 12:43 am
by rock5
After writing a long description of the strange behavior I was having, I finally figured out what was causing it. There is a bug with the new open file dialog.

To reproduce problem:
Press enter to open the dialog. MM is now screwed whether you use the dialog or not.

Observed behavior:
If you start any script such as RoMBot, keypresses such as End, Delete and Ctrl-L become unresponsive. It seems to be able to accept 1 keypress if you hold it down for a few seconds, eg. if you hold End down for a few seconds it pauses but then wont accept anymore keypressess. If instead you hold Ctrl-L down for a few seconds the script terminates.

If you manage to terminate the script then you get other strange behavior.

If you then try to start any script with

Code: Select all

startMacro(main,true)
it immediately ends with a "Script forcibly terminated".

If you run a script with

Code: Select all

startMacro(main)
so you get the message

Code: Select all

The macro is currently not running. Press the start key (F5) to begin.
You may use (F6) key to stop/pause the script.
it wont accept any keypresses. If you then switch to another window and then switch back, the moment it's active again it stops with the message "Stopping execution".

Hopefully there are enough clues for you to figure it out.

Re: MicroMacro open file dialog bug

Posted: Wed Feb 12, 2014 10:28 am
by Administrator
Very weird bug. Seems like for some reason the input queue is getting trashed after the 2nd call to GetOpenFileName(), but only if the user clicks the "Open" button (pressing ENTER doesn't seem to trigger this bug). It's screwed at the OS level, so it looks like this is another Windows bug we've uncovered. However, switching to GetAsyncKeyState() instead of GetKeyState() seems to function as a workaround.

I seem to remember a good reason I wasn't using GetAsyncKeyState() before, but the reason eludes me right now. I've attached a copy that needs some testing before I put it up on the main download page.

Re: MicroMacro open file dialog bug

Posted: Wed Feb 12, 2014 11:37 am
by rock5
That looks like it works. I was thinking of adding support for the dialog in the rombot. I thought I would just have it pop open if you don't make a selection at the waypoint list. So, if you press enter instead of making a selection. Similar to how you have it pop open if you press enter at the prompt. So I'll get the opportunity to test this version a bit while I'm doing that.