From ad9038a66e0072f5e30e8e4f5d075f3ef735a654 Mon Sep 17 00:00:00 2001 From: vincents Date: Fri, 24 Apr 2009 08:14:58 +0000 Subject: [PATCH] mouse and key input component: added function to input a string (it was only one char at a time) from javivf (issue #13575) git-svn-id: trunk@19598 - --- components/mouseandkeyinput/keyinputintf.pas | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/components/mouseandkeyinput/keyinputintf.pas b/components/mouseandkeyinput/keyinputintf.pas index 69e6479789..e01a1b49e8 100644 --- a/components/mouseandkeyinput/keyinputintf.pas +++ b/components/mouseandkeyinput/keyinputintf.pas @@ -35,6 +35,7 @@ type procedure Up(Key: Word); procedure Press(Key: Word); + procedure Press(StringValue : String); procedure Apply(Shift: TShiftState); procedure Unapply(Shift: TShiftState); @@ -64,6 +65,18 @@ begin Up(Key); end; +procedure TKeyInput.Press(StringValue: String); +var + i : Integer; +begin + i :=1; + while (i <= Length(StringValue)) do + begin + Press(Ord(StringValue[i])); + Inc(i); + end; +end; + procedure TKeyInput.Apply(Shift: TShiftState); begin if ssCtrl in Shift then Down(VK_CONTROL);