2 #This script generated hundreds of random keypresses per second,
3 # and sends them to the lyx window
4 #It requires xvkbd and wmctrl
5 #It generates a log of the KEYCODES it sends as development/keystest/out/KEYCODES
10 #os.system("mv LT/*lyx*_*
13 #os.system("sleep 20")
16 keycode=["\[Left]",'\[Right]','\[Down]','\[Up]','\[BackSpace]','\[Delete]']
22 for k in range(97, 123):
25 for k in range(97, 123):
26 keycode[:0]=["\A"+chr(k)]
28 for k in range(97, 123):
29 keycode[:0]=["\A"+chr(k)]
31 for k in range(97, 123):
32 keycode[:0]=["\C"+chr(k)]
37 print (random.randint(1,len(keycode)))
38 for k in range(97, 123):
39 print (keycode[random.randint(1,len(keycode))-1])
44 keystr=keystr+keycode[random.randint(1,len(keycode))-1]
45 os.system("wmctrl -R LyX && xvkbd -xsendevent -text '"+keystr+"';sleep 1")
46 #os.system("echo KEYCODES: '"+keystr+"' >> development/keystest/out/GDB")
47 os.system("echo `date +%s`: '"+keystr+"' >> development/keystest/out/KEYCODES")