I assume the reason why the internal Lister works correctly is that it probably waits for the ESC key to be released (key-up) before returning control to TC again.
Applications like IrfanView most likely close immediately on key-down, while the ESC key is still physically pressed. Therefore, when TC regains focus and starts re-evaluating the filtered list,
still reports ESC as active for a very short moment.
Regarding the suggestion about repeated ESC presses: I think there is a misunderstanding about how the current implementation works.
is called by Total Commander without any larger context. The plugin only receives independent match requests for individual files. I do not know:
- when a filtering operation starts,
- when it ends,
- whether more calls will follow,
- or whether TC is currently in a “slow filtering” state at all.
Because of that, there currently is only this very rudimentary check directly at the beginning of each match call:
Code: Select all
if(GetAsyncKeyState(VK_ESCAPE)) return 0;
So there is currently no state machine, timer, debounce logic, or “counting of ESC presses” behind it. The plugin simply checks the current keyboard state at that exact moment and aborts the match if ESC is still pressed.
I currently do not plan to change this behavior, since the ESC interruption was intentionally added as a simple safeguard for potentially slow filtering operations.
However, I may add an optional setting for this in a future version.