OnGesture 事件为空

OnGesture events are empty

我正在尝试为我的 Delphi / C++Builder 10.2 Tokyo 应用程序获取交互式手势识别(特别是缩放和平移)。

到目前为止我做了什么:

  1. 将 TGestureManager GestureManager1 添加到我的表单中。
  2. 将表单的 Touch.GestureManager 设置为 GestureManager1
  3. 不要选中 Touch.Gestures 下的所有内容,因为我想要交互式手势(缩放和平移),而不是 "standard" 手势。
  4. 确保选中 Touch.InteractiveGestures.igZoom
  5. 分配一个 OnGesture 事件处理程序。

OnGesture 事件处理程序按预期触发,但事件的 EventInfo.GestureID(应该给出手势类型 - 平移、缩放等)始终为 0。

我做错了什么?

"Standard"手势(Touch.Gestures.Standard和"interactive"手势(平移、缩放、旋转)下的各种线条和形状是互斥的。

要处理 "standard" 或 "custom" 手势",添加 TGestureManager

要接收 "interactive" 手势,您需要移除 TGestureManagerThis Embarcadero DocWiki article,其中解释了手势在 VCL 和 FireMonkey 中的工作原理,具体说:

In order to use Interactive Gestures such as zoom and rotate in a component, you do not need to associate the component with a Gesture Manager.

This Intel article 有更多关于 Windows 各种手势界面的详细信息。 Delphi所谓"interactive"手势对应Windows'WM_GESTURE消息