Adobe AIR:触摸屏无法正确触发鼠标按下事件

发布于 2024-08-25 08:09:23 字数 494 浏览 4 评论 0原文

我用 as3 设计了一个游戏亭应用程序 我在 Windows 7 的索尼 vaio l 电脑(如惠普的 touchsmarts)上使用它 该应用程序不需要任何多点触摸手势(仅单点触摸单击和拖动),因此我使用鼠标事件

一切都很好(包括鼠标单击和移动事件),除了对屏幕的单点触摸(不移动)不会不要按下鼠标。仅在手指

在应用程序外轻轻移动后才会触发,在我的桌面上,我看到小 Windows 7 光标立即跳转到手指放置的位置,这意味着这个问题不是硬件或 Windows 问题,而是Flash 应用程序如何在内部从操作系统接收“翻译的”触摸鼠标事件。

例如,在 Windows 纸牌游戏中,只需触摸屏幕即可立即突出显示所触摸的纸牌。 在我的应用程序中,只有当我触摸按钮并稍微移动手指时,按钮才会更改为按下状态(单击事件 - 向下和向上 - 都可以正常触发)

MOUSE_DOWN 事件的触发方式不应该与 TOUCH_BEGIN 中的 TOUCH_BEGIN 完全一样吗?新的触摸事件类?

有什么想法吗?

i have designed a gaming kiosk app in as3
i am using it on a Sony vaio l pc (like hp's touchsmarts) in windows 7
the app doesn't need any multi-touch gestures (only single touch clicks and drags) so i am using mouse events

everything is fine (including mouse click and move events) except that a single touch to the screen (with no move) doesn't fire a mouse down. it is fired only after a small move of the finger

outside the app, on my desktop, i see that the small windows 7 cursor jumps immediately to where a finger is placed, meaning this issue isn't a hardware or a windows problem but rather how internally the flash app receives "translated" touch-to-mouse events from the os.

for example, in a windows Solitaire game, a simple touch to the screen immediately highlights the touched card.
in my app, a button will change to the down state only if i touch it and also move my finger slightly (click events - down and up - are triggered fine)

shouldn't the MOUSE_DOWN event trigger exactly like how a TOUCH_BEGIN would in the new touchevent class?

any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

我的鱼塘能养鲲 2024-09-01 08:09:23

我遇到了同样的问题。

Multitouch.inputMode 属性设置为 MultitouchInputMode.TOUCH_POINT(默认值为 MultitouchInputMode.GESTURE) 似乎会使 MOUSE_DOWN code> 事件在用户触摸屏幕时调度,而不是在触摸并移动或触摸并释放时调度。

I encountered the same problem.

Setting the Multitouch.inputMode property to MultitouchInputMode.TOUCH_POINT (the default value is MultitouchInputMode.GESTURE) appears to make the MOUSE_DOWN event dispatch when the user touches the screen and not when they touch and move or touch and release.

靖瑶 2024-09-01 08:09:23

如果光标在触摸时移动,那么我假设操作系统只是将其注册为 MOUSE_MOVE 而不是 MOUSE_DOWN。由于它是触摸屏,因此您可以将 MOUSE_MOVE 视为单击,因为用户可能实际上并未拖动手指来创建真正的 MOUSE_MOVE 事件。

好吧,如果他们实际上是在拖动手指进行操作,那么您可以假设 MOUSE_MOVE 突然将光标放在按钮上(没有先前的 MOUSE_MOVE,即拖动),它是 MOUSE_DOWN。

If the cursor moves when they touch, then I assume the OS is just registering this as a MOUSE_MOVE and not a MOUSE_DOWN. Since it's a touchscreen, you could just consider MOUSE_MOVE a click since the user probably isn't actually dragging their finger around creating a real MOUSE_MOVE event.

Well, if they are actually dragging their finger around for stuff then you could assume a MOUSE_MOVE that suddenly places the cursor on a button (with no prior MOUSE_MOVE i.e. dragging), it's a MOUSE_DOWN.

梦里南柯 2024-09-01 08:09:23

刚买了新的触摸屏,又遇到了这个问题。

因此,解决方案是通过在代码中的任意位置写入来将 Multitouch.inputMode 设置为 MultitouchInputMode.TOUCH_POINT

Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;

注意,测试时它不起作用通过 Ctrl+Enter 在 Flash 编辑器中(至少在 CC 2015 中)。因此,例如,您需要在 Flash Player 中单独打开 .SWF

编辑:但它确实可以在调试模式下工作! (Ctrl+Shift+Enter

Just bought a new touchscreen and encountered the problem again.

So the solution is to set Multitouch.inputMode to MultitouchInputMode.TOUCH_POINT by writing anywhere in your code:

Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;

Notice, that it does not work when testing by Ctrl+Enter in Flash Editor (at least in CC 2015). So, for example, you need to open .SWF separately in Flash Player.

EDIT: But it does work in Debug mode! (Ctrl+Shift+Enter)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文