mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
f3b253f9ad
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30122 a592a061-630c-0410-9148-cb99ea01b6c8
48 lines
1.1 KiB
Python
Executable File
48 lines
1.1 KiB
Python
Executable File
#!/usr/bin/env python
|
|
#This script generated hundreds of random keypresses per second,
|
|
# and sends them to the lyx window
|
|
#It requires xvkbd and wmctrl
|
|
#It generates a log of the KEYCODES it sends as development/keystest/out/KEYCODES
|
|
|
|
import random
|
|
import os
|
|
|
|
#os.system("mv LT/*lyx*_*
|
|
|
|
#os.system("lyx &")
|
|
#os.system("sleep 20")
|
|
|
|
|
|
keycode=["\[Left]",'\[Right]','\[Down]','\[Up]','\[BackSpace]','\[Delete]']
|
|
keycode[:0]=keycode
|
|
keycode[:0]=keycode
|
|
|
|
keycode[:0]=['\\']
|
|
|
|
for k in range(97, 123):
|
|
keycode[:0]=chr(k)
|
|
|
|
for k in range(97, 123):
|
|
keycode[:0]=["\A"+chr(k)]
|
|
|
|
for k in range(97, 123):
|
|
keycode[:0]=["\A"+chr(k)]
|
|
|
|
for k in range(97, 123):
|
|
keycode[:0]=["\C"+chr(k)]
|
|
|
|
|
|
print (keycode[1])
|
|
print(keycode)
|
|
print (random.randint(1,len(keycode)))
|
|
for k in range(97, 123):
|
|
print (keycode[random.randint(1,len(keycode))-1])
|
|
|
|
while True:
|
|
keystr=""
|
|
for k in range(1,80):
|
|
keystr=keystr+keycode[random.randint(1,len(keycode))-1]
|
|
os.system("wmctrl -R LyX && xvkbd -xsendevent -text '"+keystr+"';sleep 1")
|
|
#os.system("echo KEYCODES: '"+keystr+"' >> development/keystest/out/GDB")
|
|
os.system("echo `date +%s`: '"+keystr+"' >> development/keystest/out/KEYCODES")
|