How to call a hotkey handler function from elsewhere
I am setting a hot key to stop my scripts with the following:
Env.addHotkey(
And my breakscript definition:
def breakscript(self, event):
App.
click(
wheel(
exit(1)
This code works great and I use it all the time to stop my scripts and have it return my ArcMap to the correct zoom level. But what if I wanted to call breakscript from anywhere else? I would need to create a SikuliEvent object to pass to it as "event". I've tried a couple ways to instantiate that object, but the compiler just keeps telling me that "AttributeError: 'module' object has no attribute: 'SikuliEvent'" or "NameError: global name 'SikuliEvent' is not defined". I have the following import at the top of my file:
from sikuli import *
So, is it possible to manually create an event object outside of a addHotKey or some kind of onAppear procedure? What is the correct syntax for doing so?
Thanks,
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Greg Howell
- Solved:
- Last query:
- Last reply: