hedgewars/uTouch.pas
changeset 6955 71498ea59193
parent 6951 a37e470c8694
child 6956 7d9e2669c2f5
equal deleted inserted replaced
6954:a61458a81480 6955:71498ea59193
   275 end;
   275 end;
   276 
   276 
   277 procedure onTouchLongClick(finger: TTouch_Data);
   277 procedure onTouchLongClick(finger: TTouch_Data);
   278 begin
   278 begin
   279 {$IFDEF USE_TOUCH_INTERFACE}
   279 {$IFDEF USE_TOUCH_INTERFACE}
   280 WriteLnToConsole('blabla');
       
   281 if isOnWidget(jumpWidget, finger) then
   280 if isOnWidget(jumpWidget, finger) then
   282     begin
   281     begin
   283     ParseTeamCommand('ljump');
   282     ParseTeamCommand('ljump');
   284     exit;
   283     exit;
   285     end;
   284     end;
   560 
   559 
   561 //Method to calculate the distance this finger has moved since the downEvent
   560 //Method to calculate the distance this finger has moved since the downEvent
   562 function fingerHasMoved(finger: TTouch_Data): boolean;
   561 function fingerHasMoved(finger: TTouch_Data): boolean;
   563 begin
   562 begin
   564     fingerHasMoved := trunc(sqrt(sqr(finger.X-finger.historicalX) + sqr(finger.y-finger.historicalY))) > 30;
   563     fingerHasMoved := trunc(sqrt(sqr(finger.X-finger.historicalX) + sqr(finger.y-finger.historicalY))) > 30;
   565     WriteLnToConsole(inttostr(ord(fingerHasMoved)) + ' xy' + inttostr(finger.x) + ' ' + inttostr(finger.historicalx));
       
   566 end;
   564 end;
   567 
   565 
   568 function calculateDelta(finger1, finger2: TTouch_Data): LongInt; inline;
   566 function calculateDelta(finger1, finger2: TTouch_Data): LongInt; inline;
   569 begin
   567 begin
   570     calculateDelta := Round(sqrt(sqr(finger2.x-finger1.x) + sqr(finger2.y-finger1.y)));
   568     calculateDelta := Round(sqrt(sqr(finger2.x-finger1.x) + sqr(finger2.y-finger1.y)));