Wrap Alt-Shift-C

Asked by Kyle

I have a script that updates a log file. I've written it in such a way that my script runs indefinitely and the only way to end it is by pressing the Alt-Shift-C. Is there a way to wrap Alt-Shift-C event so that I can properly close my file object? I would like to avoid opening and closing my log file when needed because I have wrapped the click function to write into the file whenever it is called... and I happen to call it very frequently and speed is an issue.

Thanks in advance!

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

What about implementing your own hotkey, which by design has a handler function, where you could close the logfile and then terminate.

http://sikulix-2014.readthedocs.io/en/latest/interaction.html#listening-to-global-hotkeys

Revision history for this message
Kyle (kshong1990) said :
#2

I think I'll add a hotkey for CTRL + c instead.

Thanks for the suggestion RaiMan.

Revision history for this message
Kyle (kshong1990) said :
#3

Thanks RaiMan, that solved my question.