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. JS BOM操作

    Bom:浏览器对象模型(Browser Object Model,简称 BOM)提供了独立于内容而与浏览器窗口进行交互的对象.描述了与浏览器进行交互的方法和接口,可以对浏览器窗口进行访问和操作 (1) ...

  2. 003——数组(三)count()reset()end()prev()next()current()

    <?php /** * count 统计数组中元素的个数 */ /*$arr=array('blog.com','博客论坛',array('php课程','css课程')); echo coun ...

  3. POJ 3126 Prime Path 广度优先搜索 难度:0

    http://poj.org/problem?id=3126 搜索的时候注意 1:首位不能有0 2:可以暂时有没有出现在目标数中的数字 #include <cstdio> #include ...

  4. 转载 ORACLE中实现表变量的方法

    源文地址:http://blog.itpub.net/750077/viewspace-2134222/ 经常看到SQLSERVER 中用表变量类型的方式就能做到缓存一个比较大的中间结果, 然后再对这 ...

  5. pycharm 教程(一)安装和首次使用

    PyCharm 是我用过的Python编辑器中,比较顺手的一个.而且可以跨平台,在 mac 和 windows 下面都可以用,这点比较好. 首先预览一下 PyCharm 在实际应用中的界面:(更改了P ...

  6. linux 网络测试命令 长期更新

    一.网络测试命令 1.测试 网络连接 发送两包后停发 [oracle@hadoop ~]$ PING www.a.shifen.com (() bytes of data. bytes from tt ...

  7. MQTT再学习 -- 搭建MQTT服务器及测试

    最近在搞 PM2.5 采集,需要用到 MQTT 传输协议.协议部分看了几天的,讲的七七八八.本身在 intel 上有 写好的MQTT 的源码,现在的工作其实也就是移植到单片机上或者DM368板卡上.不 ...

  8. [QT_QML]qml假如调试信息 qDebug console.debug

    WinSys: win7 Qt Version: 5.8.0 使用Console调试 console.log 打印日志信息console.debug 打印调试信息console.info 打印普通信息 ...

  9. [QT][SQLITE]学习记录一 querry 查询

    使用 QSqlQuery query ; query("SELECT id FROM TABLE1 WHERE id = '2017'); 的到的结果集就是query本身,此时需要使用 qu ...

  10. HDU3530 Subsequence(单调队列)

    题意是说给出一个序列,现在要求出这个序列的一个最长子区间,要求子区间的最大值与最小值的差在[m, k]范围内,求区间长度 做法是维护两个队列,一个维护到当前位置的最大值,一个维护最小值,然后计算当前节 ...