delphi手势,左右滑动,

控件的OnGesture事件写代码。

放一个TGestureManager控件,设置控件的touch属性为TGestureManager控件。

然后勾选控件的Touch>Gestures>Standard>里的手势类型,left,right,up,down等等,然后在OnGesture事件就可以捕捉到了。

官方的手势图

http://docwiki.embarcadero.com/RADStudio/Berlin/en/TStandardGesture_Enum

Field Description

GestureID

The ID of the gesture that is emitted. ID is an integer value uniquely identifying the gesture.

Location

The current point on the control's surface. Location contains the X and Y coordinates of the last known point.

Flags

A set of TInteractiveGestureFlag options describing the state of the interactive gesture. Flags is only valid if the gesture is interactive.

Angle

The angle in radians (rad) in which either the finger or a gesturing device has moved relative to the screen coordinates.

Angle is only set for the rotation gesture (TInteractiveGesture = Rotate):

  • Angle is negative if rotation is clockwise.
  • Angle is positive if rotation is counter-clockwise.

Distance

The distance in pixels from the current point, given by Location, and the previous point.

Distance is only set for the zoom and two finger tap gestures (TInteractiveGesture = Zoom or TwoFingerTap). Distance is the distance between the two fingers or gesturing devices that are making the gesture.

InertiaVector

The inertia speed given by an X and Y pair. A positive X value means inertia toward the right of the screen, while a negative value means inertia to the left. A positive Y value means inertia toward the bottom of the screen, while a negative value means inertia to the top. InertiaVector is only valid if the event is interactive.

TapLocation

Specifies the coordinates of the "tap" and "press and tap" (igPressAndTap) gestures.

procedure TForm1.GridPanelLayout1Gesture(Sender: TObject;
const EventInfo: TGestureEventInfo; var Handled: Boolean);
begin
case EventInfo.GestureID of
sgiRight://向右滑动
begin end;
end;
end;
case EventInfo.GestureID of
sgiLeft:
begin
if TabControl1.ActiveTab <> TabControl1.Tabs[TabControl1.TabCount - ] then
TabControl1.ActiveTab := TabControl1.Tabs[TabControl1.TabIndex + ];
Handled := True;
end; sgiRight:
begin
if TabControl1.ActiveTab <> TabControl1.Tabs[] then
TabControl1.ActiveTab := TabControl1.Tabs[TabControl1.TabIndex - ];
Handled := True;
end;
end;

返回键

procedure TTabbedwithNavigationForm.FormKeyUp(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState);
begin
if Key = vkHardwareBack then
begin
if (TabControl1.ActiveTab = TabItem1) and (TabControl2.ActiveTab = TabItem6) then
begin
TabControl2.Previous;
Key := ;
end;
end;

touch与mouseup事件,先出发mouseUp事件,然后才触发ontouch事件。

delphi 触摸 手势的更多相关文章

  1. Android 触摸手势基础 官方文档概览

    Android 触摸手势基础 官方文档概览 触摸手势检测基础 手势检测一般包含两个阶段: 1.获取touch事件数据 2.解析这些数据,看它们是否满足你的应用所支持的某种手势. 相关API: Moti ...

  2. 移动开发框架,Hammer.js&nbsp;移动设备触摸手势js库

    hammer.js是一个多点触摸手势库,能够为网页加入Tap.DoubleTap.Swipe.Hold.Pinch.Drag等多点触摸事件,免去自己监听底层touchstart.touchmove.t ...

  3. Android 触摸手势基础 官方文档概览2

    Android 触摸手势基础 官方文档概览 触摸手势检测基础 手势检测一般包含两个阶段: 1.获取touch事件数据 2.解析这些数据,看它们是否满足你的应用所支持的某种手势. 相关API: Moti ...

  4. 移动开发框架,第【二】弹:Hammer.js 移动设备触摸手势js库

    hammer.js是一个多点触摸手势库,能够为网页加入Tap.Double Tap.Swipe.Hold.Pinch.Drag等多点触摸事件,免去自己监听底层touchstart.touchmove. ...

  5. 20个Mac用户必须掌握的触摸手势

    我第一次接触MacBook时,最令我惊叹的就是MacBook的触摸板,通过各种手势,完全可以不用鼠标,且有些时候更加的快捷和方便.那么都有哪些手势呢?可以通过 -> 来查看学习各种手势的使用,下 ...

  6. Android之触摸手势检测GestureDetector使用详解

    在Android中,当用户触摸屏幕的时候,会产生许多手势,例如down,up,scroll,filing,onSingleTapConfirmed(单击),onDoubleTap(双击)等等. 一般情 ...

  7. Qt for android触摸手势事件QGestureEvent

    在触摸设备上可以使用Qt的手势事件 要激活手势事件,需要执行以下操作: 第一步,为QWidget控件注册手势事件 QList<Qt::GestureType> gestures; gest ...

  8. 错误总结之播放器(vitamio)音量实体键与触摸手势控制,音量调节冲突

    这个但是独家心得:经过几天的网上资料查询未果,在群里遇到一同行. 然后让他帮我看了看,终于攻克了该冲突. 此时,谨以此来感谢那位同僚的热情帮助: 说说这个问题吧: 眼下我在做一款影视方面的项目,在该项 ...

  9. Quo JS多种触摸手势轻量级JavaScript库

    http://www.uedsc.com/quo-js.html http://quojs.tapquo.com/

随机推荐

  1. OSI七层与tcp/ip四层

    1)OSI七层模型 OSI中的层 功能 TCP/IP协议族 应用层 文件传输,电子邮件,文件服务,虚拟终端 TFTP,HTTP,SNMP,FTP,SMTP,DNS,Telnet 表示层 数据格式化,代 ...

  2. UVA-11248 Frequency Hopping (最大流+最小割)

    题目大意:给一张网络,问是否存在一条恰为C的流.若不存在,那是否存在一条弧,使得改动这条弧的容量后能恰有为C的流? 题目分析:先找出最大流,如果最大流不比C小,那么一定存在一条恰为C的流.否则,找出最 ...

  3. halcon之最小二乘拟合直线

    如果不了解最小二乘算法 请先阅读: Least squares的算法细节原理https://en.wikipedia.org/wiki/Least_squares 通常在halcon中拟合直线会用ho ...

  4. 模板方法模式templeteMethod

    引出模板模式: 考试试卷问题,提炼后的代码: package com.disign.templetemethod; import org.junit.Test; /** * Created by zh ...

  5. 用pil产生验证码出现:ImportError: The _imagingft C module is not installed

    这个是由于PIL没有编译freetype导致的查看 lib/python2.7/site-packages/PIL/看看 _imagingft.so 是否存在 # 需要先安装jpeg库wget htt ...

  6. Redis3.0集群

    Redis集群介绍 Redis 集群是一个提供在多个Redis间节点间共享数据的程序集. Redis集群并不支持处理多个keys的命令,因为这需要在不同的节点间移动数据,从而达不到像Redis那样的性 ...

  7. JQ深度手记、源码分析

    1.$.extend() 对象继承操作.浅拷贝操作.深拷贝操作(第一个参数:true) var a = { name:'lisan' }; var b = {}; $.extend(b, a); // ...

  8. vi/vim使用进阶: 在VIM中使用GDB调试 – 使用vimgdb

    vi/vim使用进阶: 在VIM中使用GDB调试 – 使用vimgdb << 返回vim使用进阶: 目录 本节所用命令的帮助入口: :help vimgdb 在UNIX系统最初设计时,有一 ...

  9. 6-11 Level-order Traversal(25 分)

    Write a routine to list out the nodes of a binary tree in "level-order". List the root, th ...

  10. DesignPattern(三)结构型模式(上)

    结构型模式 结构型模式,顾名思义讨论的是类和对象的结构 ,主要用来处理类或对象的组合.它包括两种类型,一是类结构型模式,指的是采用继承机制来组合接口或实现:二是对象结构型模式,指的是通过组合对象的方式 ...