触摸事件和点击事件相同吗? [英] Touch event and click event are same?

查看:175
本文介绍了触摸事件和点击事件相同吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual C ++/MFC处理基于桌面的项目.有很多按钮.但是问题是,它应该可以在没有鼠标/键盘的触摸屏显示器上工作.

I am working on a Desktop based project using visual C++/MFC. There are lots of buttons. But problem is, It should work on touch screen monitor where no mouse/keyboard are available.

那么,ON_BN_CLICKED是否可以在触摸屏监视器中用作触摸事件?还是我必须以其他方式处理?

So, will ON_BN_CLICKED work as touch event in touch screen monitor? Or I have to handle it other ways?

推荐答案

通过触摸"事件,如果您是指屏幕轻击,则是,可以将它们视为相同.

By "Touch" event if you mean screen tap then Yes, they CAN be treated as same.

Windows 7为应用程序提供了内置支持,这些应用程序不提供任何对触摸和墨水支持的明确支持,无法通过屏幕键盘和书写板接收输入.

Windows 7 provides built in support for applications that do not provide any explicit support for touch and ink support to receive input via the Onscreen Keyboard and Writing Pad.

Windows将主要在与鼠标相同的模式下使用触摸,其屏幕点击等同于鼠标单击.因此,"ON_BN_CLICKED"将适用于屏幕点击.

Windows will primarily use touch in much the same mode as a mouse, with screen taps equating to mouse clicks. So, 'ON_BN_CLICKED' will work for screen taps.

话虽如此,您可以通过以下两种方式之一来提供对Touch支持的显式支持:

That being said, you can provide explicit support for Touch support in one of two ways:

手势:Windows提供的将独特的触摸序列映射到手势(如缩放和平移)的映射. MFC进一步将这些手势转换为一组简化的CWnd虚拟方法,可以根据需要重写这些方法.

Gestures: Windows-provided mapping of distinctive touch sequences into gestures like zoom and pan. MFC further translates these gestures into a simplified set of CWnd virtual methods that can be overridden as required.

OnGestureZoom(CPoint ptCenter, long lDelta)
OnGesturePan(CPoint ptFrom, CPoint ptTo)
OnGestureRotate(CPoint ptCenter, double dblAngle)
OnGestureTwoFingerTap(CPoint ptCenter)
OnGesturePressAndTap(CPoint ptPress, long lDelta)

触摸消息:注册以接收可能同时来自多个触摸点的低级触摸消息,并在消息处理程序中响应这些触摸事件.

Touch Messages: Registering to receive the low-level touch messages which may be coming from multiple touch points simultaneously, and responding to these touch events in the message handler.

virtual BOOL OnTouchInput(CPoint pt, int nInputNumber, int nInputsCount, PTOUCHINPUT pInput);

来源:检查

Source: Check this article for details.

这篇关于触摸事件和点击事件相同吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆