mirror of
https://github.com/moparisthebest/Simba
synced 2025-02-18 00:00:23 -05:00
FUCKING ANNOYING BUG FIXED
git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@225 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
parent
f8fc7069d3
commit
7ecefaaa9b
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
This file is part of the Mufasa Macro Library (MML)
|
This file is part of the Mufasa Macro Library (MML)
|
||||||
Copyright (c) 2009 by Raymond van Venetië and Merlijn Wajer
|
Copyright (c) 2009 by Raymond van Venetië and Merlijn Wajer
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ type
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Client,{$IFDEF MSWINDOWS}windows {$ELSE}lcltype{$ENDIF};
|
Client,{$IFDEF MSWINDOWS}windows {$ENDIF},lcltype;
|
||||||
|
|
||||||
{$IFDEF MSWINDOWS}
|
{$IFDEF MSWINDOWS}
|
||||||
type
|
type
|
||||||
@ -161,29 +161,38 @@ end;
|
|||||||
|
|
||||||
{ No using VkKeyScan }
|
{ No using VkKeyScan }
|
||||||
function GetSimpleKeyCode(c: char): word;
|
function GetSimpleKeyCode(c: char): word;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
//result := ord(UpCase(c));
|
case C of
|
||||||
c := lowerCase(c);
|
'0'..'9' :Result := VK_0 + Ord(C) - Ord('0');
|
||||||
if ((c >= 'a') and (c <= 'z')) then
|
'a'..'z' :Result := VK_A + Ord(C) - Ord('a');
|
||||||
Exit(VK_A + (Byte(c) - 97));
|
'A'..'Z' :Result := VK_A + Ord(C) - Ord('A');
|
||||||
Raise Exception.CreateFMT('GetSimpleKeyCode - char is not in A..z',[]);
|
' ' : result := VK_SPACE;
|
||||||
|
else
|
||||||
|
Raise Exception.CreateFMT('GetSimpleKeyCode - char (%s) is not in A..z',[c]);
|
||||||
|
end
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMInput.SendText(text: string);
|
procedure TMInput.SendText(text: string);
|
||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
|
HoldShift : boolean;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
HoldShift := false;
|
||||||
for i := 1 to length(text) do
|
for i := 1 to length(text) do
|
||||||
begin
|
begin
|
||||||
if((text[i] >= 'A') and (text[i] <= 'Z')) then
|
if((text[i] >= 'A') and (text[i] <= 'Z')) then
|
||||||
|
begin;
|
||||||
Self.KeyDown(VK_SHIFT);
|
Self.KeyDown(VK_SHIFT);
|
||||||
|
HoldShift:= True;
|
||||||
Self.PressKey(ord(upcase(text[i])));
|
Text[i] := lowerCase(Text[i]);
|
||||||
//Self.PressKey(GetSimpleKeyCode(text[i]));
|
end else
|
||||||
|
if HoldShift then
|
||||||
if((text[i] >= 'A') and (text[i] <= 'Z')) then
|
begin
|
||||||
Self.KeyUp(VK_SHIFT);
|
HoldShift:= false;
|
||||||
|
Self.KeyUp(VK_SHIFT);
|
||||||
|
end;
|
||||||
|
Self.PressKey( GetSimpleKeyCode(Text[i]));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -290,6 +299,7 @@ begin
|
|||||||
{$IFDEF MSWINDOWS}
|
{$IFDEF MSWINDOWS}
|
||||||
GetWindowRect(TClient(Client).MWindow.TargetHandle, Rect);
|
GetWindowRect(TClient(Client).MWindow.TargetHandle, Rect);
|
||||||
Input.Itype:= INPUT_MOUSE;
|
Input.Itype:= INPUT_MOUSE;
|
||||||
|
FillChar(Input,Sizeof(Input),0);
|
||||||
Input.mi.dx:= x + Rect.left;
|
Input.mi.dx:= x + Rect.left;
|
||||||
Input.mi.dy:= y + Rect.Top;
|
Input.mi.dy:= y + Rect.Top;
|
||||||
if mPress = mouse_Down then
|
if mPress = mouse_Down then
|
||||||
|
Loading…
Reference in New Issue
Block a user