speed of keystrokes with type() --- Settings.TypeDelay

Asked by Brian Shaw

from the docs:
http://sikulix-2014.readthedocs.io/en/latest/scripting.html#controlling-sikuli-scripts-and-their-behavior

--- Settings.TypeDelay
Specify a delay between the key presses in seconds as 0.nnn. This only applies to the next click action and is then reset to 0 again. A value > 1 is cut to 1.0 (max delay of 1 second)

if more than one second between keystrokes is needed or it must be variable: see comment #1

-----------------------------------------------------------

I have a program that needs to accept data at a specific typing rate. Is there an easy way to do this in Sikulix?

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Roman Podolyan (podolyan-roman) said :
#2

Fixed and tested example (use some text editor blank document opened on screen for demo)
_________

def type_slow(data,interval):
    letters = list(data)
    for i in range(0, len(data)):
        type(letters[i])
        time.sleep(interval)

click(Location(400,400))
type_slow("Hello world!",0.3)

Revision history for this message
Roman Podolyan (podolyan-roman) said :
#3

Oops, put time module import statement first:

import time

Revision history for this message
RaiMan (raimund-hocke) said :
#4

if max 1 sec between strokes is sufficient:
Settings.TypeDelay (see in the post text above)

Can you help with this problem?

Provide an answer of your own, or ask Brian Shaw for more information if necessary.

To post a message you must log in.