Ce type a écrit un script Python qui ajoute des raccourcis clavier à la version Windows.
import os
import sys
import time
from msvcrt import getch
sys.path.append("../win32automation")
import win32automation
os.system("title KeySetta")
win32automation.spawnProcess(
r"C:\Program Files\The Rosetta Stone\The Rosetta Stone\TheRosettaStone.exe")
while 1:
print "Waiting for application to start..."
result = win32automation.windowFocus("The Rosetta Stone")
if result:
print "Window found!"
break
time.sleep(1.0)
print "Waiting 5 seconds for login screen to appear..."
time.sleep(5.0)
win32automation.sendKeys('jordanh{ENTER}')
print """
Keyboard to Mouse Macros Enabled:
- Answer selection:
[7] [9]
[1] [3]
Please focus this window to enable them...
"""
coord_map = {"7": (180, 300),
"9": (480, 300),
"1": (180, 475),
"3": (480, 475)}
while 1:
win32automation.windowFocus("KeySetta")
ch = getch()
print "Last key pressed: %s\r" % (ch),
if ch in ('1','3','7','9'):
win32automation.windowFocus("The Rosetta Stone")
x, y = coord_map[ch]
win32automation.mouseMoveToRelative("The Rosetta Stone", x, y)
win32automation.mouseClick(button="left")
elif ch.lower() == 'q':
print "Quitting!"
break
else:
print "WARNING: Unknown key-macro event '%c'." % (ch)
sys.exit()
0 votes
Postez une capture d'écran de ce à quoi ressemblent les quiz.