--- a/SimpleView.st Mon Sep 30 08:45:20 2019 +0200
+++ b/SimpleView.st Wed Oct 02 02:21:35 2019 +0200
@@ -7308,16 +7308,22 @@
simulateTextInput:aString at:aPoint sendDisplayEvent:sendDisplayEvent
"simulate text input by generating alternating keyPress/keyRelease events."
+ self simulateTextInput:aString at:aPoint sendDisplayEvent:sendDisplayEvent keyPressTime:0.05
+!
+
+simulateTextInput:aString at:aPoint sendDisplayEvent:sendDisplayEvent keyPressTime:seconds
+ "simulate text input by generating alternating keyPress/keyRelease events."
+
aString do:[:eachCharacter |
(eachCharacter isLetter and:[eachCharacter isUppercase]) ifTrue:[
self simulateKeyPress:#Shift at:aPoint sendDisplayEvent:sendDisplayEvent.
self simulateKeyPress:eachCharacter asLowercase at:aPoint sendDisplayEvent:sendDisplayEvent.
- Delay waitForSeconds:0.1.
+ Delay waitForSeconds:seconds.
self simulateKeyRelease:eachCharacter asLowercase at:aPoint sendDisplayEvent:sendDisplayEvent.
self simulateKeyRelease:#Shift at:aPoint sendDisplayEvent:sendDisplayEvent.
] ifFalse:[
self simulateKeyPress:eachCharacter at:aPoint sendDisplayEvent:sendDisplayEvent.
- Delay waitForSeconds:0.1.
+ Delay waitForSeconds:seconds.
self simulateKeyRelease:eachCharacter at:aPoint sendDisplayEvent:sendDisplayEvent.
].
].