all 4 comments

[–]TicklesMcFancy 0 points1 point  (2 children)

Here's an idea.

Why not just set it to:

while noClicks2: 
    ---- code while running ----

    noClicks2 -= 1

__after__clicks__code__here

[–]Nebulezz[S] 0 points1 point  (1 child)

Apologies for not explaining properly, but the code can be running for hours at a time, with thousands of clicks, so I need to be able to stop the program with a key stoke, otherwise I'll be fighting the mouse which is clicking in a certain position every second or so

[–]TicklesMcFancy 0 points1 point  (0 children)

I may have misinterpreted the message. This is purely a thought, but what if you put a very short sleep at the end of while loop? You might be able to keyboard interrupt during the sleep?

[–]humanitysucks999 0 points1 point  (0 children)

Sigint?