When creating an Env.addHotkey, using an import function as the handler causes the hotkey to trigger as soon as you start the script.
Asked by
Joshua Noble
Using two scripts in conjunction here. I will use scripts 'A' and 'B' as my examples with functions to match:
#######
from sikuli import *
def a():
print ("hello world")
#######
import scriptA
from scriptA import a
Env.addHotkey(
-------
The result here is that as soon as you launch script B, the function 'a' will trigger. If you move this function into scriptB.py, then the hotkey works as intended.
Does anyone have any suggestions? RaiMan, you're my only hope!
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Joshua Noble
- Solved:
- Last query:
- Last reply:
To post a message you must log in.