weequ
2010-07-13 13:56:15
Ok… Im trying to create a fast text sender procedure for smart since it doesn't have one.
I need a procedure Like SendKeys in scar. SendKeys in smart is way too slow for my purpose.
So only things I can use are KeyDown and KeyUp. Well everthing worked good until I had to use keys like / and \ that are accessed through shift and combination of alt and ctrl.
This procedure works fine without smart in scar but has problems in smart.
I need a procedure Like SendKeys in scar. SendKeys in smart is way too slow for my purpose.
So only things I can use are KeyDown and KeyUp. Well everthing worked good until I had to use keys like / and \ that are accessed through shift and combination of alt and ctrl.
This procedure works fine without smart in scar but has problems in smart.
procedure SendTextSmartFast(S: String);
var
I: Integer;
begin
for I := 1 to Length(S) do
begin
if InStrArr(S[I], ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'Q','X', 'Y', 'Z', '!', '"', '#',
'¤', '%', '&', '/', '(', ')', '*', '_', ':', ';', '>', '½', '?'], true) then KeyDown(VK_Shift);
if InStrArr(S[I], ['\', '[', ']', '{', '$', '@', '£', '|'], true) then
begin
KeyDowN(VK_CONTROL);
Wait(5);
KeyDown(VK_Menu);
end;
KeyDown(GetKeyCode(S[I]));
Wait(5);
KeyUp(GetKeyCode(S[I]));
KeyUp(Vk_Shift);
KeyUp(VK_CONTROL);
KeyUp(VK_MENU);
end;
KeyDown(13);
Wait(10);
KeyUp(13);
end;