GestureRecognizer无法正常工作 [英] GestureRecognizer not working
问题描述
m_gestureRec = ref new Windows::UI::Input::GestureRecognizer();
GameManager::m_inputManager->m_PointerPressed += ref new InputManager::PointerPressedDelegate([=](Windows::UI::Core::PointerEventArgs^ args)
{
m_gestureRec->ProcessDownEvent(args->CurrentPoint);
//m_zoom += 0.01f;
});
m_gestureRec->GestureSettings =
Windows::UI::Input::GestureSettings::Tap;
m_gestureRec->Tapped += ref new TypedEventHandler<GestureRecognizer^, TappedEventArgs^>
([=](GestureRecognizer^ r, TappedEventArgs^ e)
{
m_zoom += 1;
});
<我正在创建一个DirectX,Windows 8游戏,我需要检测手势。不幸的是,我的GestureRecognizer无法正常工作。我在处理程序中放了一个断点,但它没有打到。 我知道指针按下事件有效,我在那里有一个断点
并且它经常被击中。
I'm creating a DirectX, Windows 8 game and I need to detect gestures. Unfortunately, my GestureRecognizer isn't working. I've put a breakpoint in the handler but, it doesn't ever hit. I know that the pointer pressed event works, I have a breakpoint there and it's constantly hit.
任何帮助,谢谢。
Any help, thanks.
< span style ="color:#0000ff; font-size:small">
[url = http://catalog.create.msdn .com / zh-CN / GameDetails.aspx?catalogEntryId = 5cbacba6-05c2-4c33-9005-6cc80c8d5753& type = 1] Bible Trivia Avatar Edition [/ url],目前正在审核中。
[url=http://catalog.create.msdn.com/en-US/GameDetails.aspx?catalogEntryId=5cbacba6-05c2-4c33-9005-6cc80c8d5753&type=1]Bible Trivia Avatar Edition[/url], currently in review.
推荐答案
您是否正在传递所有Pointer事件或您的代码段中列出的ProcessDownEvent?如果没有,请执行。如果是,请您发布完整代码指针和手势处理的片段?
Are you passing all of the Pointer events or just the ProcessDownEvent as listed in your code snippet? If not, please do. If so, can you please post a complete code snippet of the pointer and gesture handling?
- Rob
这篇关于GestureRecognizer无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!