]> git.lyx.org Git - features.git/blob - development/keystest/test.py
Move to the correct directory structure.
[features.git] / development / keystest / test.py
1 #!/usr/bin/env python
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
6
7 import random
8 import os 
9
10 #os.system("mv LT/*lyx*_*
11
12 #os.system("lyx &")
13 #os.system("sleep 20")
14
15
16 keycode=["\[Left]",'\[Right]','\[Down]','\[Up]','\[BackSpace]','\[Delete]']
17 keycode[:0]=keycode
18 keycode[:0]=keycode
19
20 keycode[:0]=['\\']
21
22 for k in range(97, 123):
23   keycode[:0]=chr(k)
24
25 for k in range(97, 123):
26   keycode[:0]=["\A"+chr(k)]
27
28 for k in range(97, 123):
29   keycode[:0]=["\A"+chr(k)]
30
31 for k in range(97, 123):
32   keycode[:0]=["\C"+chr(k)]
33
34
35 print (keycode[1])
36 print(keycode)
37 print (random.randint(1,len(keycode)))
38 for k in range(97, 123):
39   print (keycode[random.randint(1,len(keycode))-1])
40
41 while True:
42   keystr=""
43   for k in range(1,80):
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")