Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The program only wants to run once . . .
#19
(07-31-2024, 09:23 AM)RhoSigma Wrote: That can't be the case as Steve added a release wait loop in PR #399 to avoid the program is started before F5 is released. That was back in v3.10.0, no idea what version KP is using though.
Looking at it now, are we sure Steve's code works as intended? The code is this:

Code: (Select All)
                _KeyClear
                Do: _Limit 15: Loop Until _KeyHit = 0 'wait for user to remove finger from F5 key before running

This isn't waiting for an F5 key release, it's just waiting for _KeyHit to return zero. That can happen while the F5 key is still held since _KeyHit only reports the press event once and then zero afterward (it will eventually start reporting the repeat key events but there's a delay before that happens).

It's interesting because it does still fix the original issue, F5 does not spam out copies of your program anymore. I wonder if the forced _Limit 15 is what actually fixes it, once the new program finishes starting up it gains focus and keypresses stop going to the IDE (at least on my computer), so maybe the _Limit 15 is really just acting as a short wait for the program to start.
Reply


Messages In This Thread
RE: The program only wants to run once . . . - by DSMan195276 - 07-31-2024, 01:49 PM



Users browsing this thread: 12 Guest(s)