使用C ++动态启用/禁用按住手势 [英] dynamically enabling/disabling the press and hold gesture using C++

查看:157
本文介绍了使用C ++动态启用/禁用按住手势的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调整我为音乐符号编写的win32程序以使用触摸输入。在我的正常输入模式中,我处理Windows手势,并且按下并按住手势到按钮右键单击的默认映射很方便。 然而,
来绘制像crescendo / diminuendo这样的音乐对象我输入了一个"对象"。模式并使用WM Touch事件绘制对象并将其放入乐谱中。 在这种模式下,我根本不需要默认的按住操作,因为我直接处理
所有触摸事件。 如何有选择地打开和关闭该操作? 在搜索答案时,我发现了一些可能适用的WM_TABLET_QUERYSYSTEMGESTURESTATUS文档,但是当Windows发送此消息时,我不清楚
以及TABLET_DISABLE_TOUCHUIFORCEON表示的行为值。 价值TABLET_DISABLE_PRESSANDHOLD是我想要做的事情的关键吗? 如果是这样,我如何操纵它来关闭/开启按住。

I am adapting a win32 program I have written for music notation to use touch input. During my normal input mode I handle Windows Gestures, and the default mapping of the press and hold gesture to a button right-click is convenient.  However, to draw musical objects like crescendo/diminuendo I enter an "object" mode and use WM Touch events to draw the objects and place them in the score.  When in this mode I don't want the default press and hold action at all, since I'm handling all the touch events directly.  How do I selectively turn that action on and off?  In searching for an answer I found some documentation on WM_TABLET_QUERYSYSTEMGESTURESTATUS that may apply, but it's not clear to me when Windows sends this message and exactly what actions values such as TABLET_DISABLE_TOUCHUIFORCEON represent.  Is the value TABLET_DISABLE_PRESSANDHOLD the key to what I want to do?  If so, how do I manipulate it to turn off/on press and hold.

推荐答案

好的,我自己也回答了这个问题。 我发现这个功能在MSDN周围翻找:

Ok, I sort of answered this myself.  I found this function rummaging around MSDN:

bool TogglePressAndHold(HWND hWnd,bool enable)

{

  //原子标识符和Tablet PC原子

  ATOM atomID = 0;

  LPCTSTR tabletAtom =" MicrosoftTabletPenServiceProperty";
bool TogglePressAndHold(HWND hWnd, bool enable)
{
  // The atom identifier and Tablet PC atom
  ATOM atomID = 0;
  LPCTSTR tabletAtom = "MicrosoftTabletPenServiceProperty";


这篇关于使用C ++动态启用/禁用按住手势的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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