有没有一种实际的方法来模拟delphi应用程序中的触摸输入,如果有,是否也可以模拟多点触摸?
问题示例:某些应用程序在某些操作中只接受触摸输入。
所需的解决方案示例:使用键盘键模拟触摸输入。能够使用键"A“来模拟触摸坐标(x,y),在(x+n,y+m)上使用键"B”,并且能够一个接一个地或者同时按下两个键,这可能是至关重要的/非常需要的。(请忽略此处3个密钥的物理限制)。
发布于 2015-05-24 22:16:36
我不知道多点触摸,但你可以模拟鼠标点击(单点触摸)。不能在像TWebBrowser,TMapView,或者TListView这样的东西上工作。从理论上讲,你可以修改火猴从硬件获取多点触摸数据的源代码,然后发送你自己的数据,但这超出了本答案的范围。
function TForm1.FindControlAtPoint(aParent: TControl; aPos: TPointF): TControl;
var
I: Integer;
Control, ChildControl: TControl;
S: String;
begin
Result := nil;
// Check all the child controls and find the one at the coordinates
for I := aParent.Controls.Count – 1 downto 0 do
begin
Control := aParent.Controls[I];
S := Control.ClassName;
if Control.PointInObject(aPos.X, aPos.Y) then
begin
ChildControl := FindControlAtPoint(Control, aPos);
if Assigned(ChildControl) and ChildControl.HitTest then
Exit(ChildControl)
else if Control.HitTest then
Exit(Control);
end;
end;
end;有一个演示项目可以在here上使用。
https://stackoverflow.com/questions/30419010
复制相似问题