简体   繁体   English

如何在浏览器环境中获得活动的触摸事件而不发生触摸事件

[英]How to get active touch events without having a touch event in a browser environment

You can get other touch events from the targetTouches and touches properties of a TouchEvent. 您可以从targetTouches和TouchEvent的touchs属性获取其他触摸事件。 See here: https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent . 参见此处: https : //developer.mozilla.org/en-US/docs/Web/API/TouchEvent

What I'd like to do is get a list of all touches from anywhere (ie in an event handler that is not for a touch event). 我想要做的是从任何地方获得所有触摸列表(即在事件处理程序,它不是一个触摸事件)。 Is this possible? 这可能吗? How would I do that? 我该怎么做? Bonus points if you can tell me how to get the list of targetTouches active on an element. 如果您能告诉我如何在元素上激活targetTouches列表,将获得加分。

See Here 看这里

You can use 您可以使用

yourView.dispatchTouchEvent(MotionEvent.obtain); yourView.dispatchTouchEvent(MotionEvent.obtain);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在没有任何基于触摸的屏幕/设备的情况下测试基于JavaScript的触摸事件? - How to test JavaScript based touch events without having any touch based screen / device? 如何在没有大型图书馆的情况下获得触摸事件 - How do I get touch events without big library 如何在不使用jquery或触摸事件的情况下实现移动触摸? - How to implement touch in mobile without using jquery or touch events? 在启用触摸的浏览器上创建和触发触摸事件? - Creating and firing touch events on a touch enabled browser? 跨浏览器库,降低触摸事件,没有额外的重量 - Library of cross-browser, degrading touch events, without the extra weight 在PC浏览器上模拟触摸事件 - Simulating touch events on a PC browser Firefox 6 浏览器中的 Windows 7 触摸事件 - Windows 7 Touch Events in Firefox 6 Browser Microsoft Surface:如何在不被浏览器拦截的情况下允许JavaScript触摸/拖动事件? - Microsoft Surface: How do I allow JavaScript touch/drag events to work without being intercepted by the browser? 如何让 fabricJS 处理触摸事件? - how to get fabricJS to work with touch events? 是否可以通过框架(在移动浏览器上)获得触摸事件? - Is it possible to get touch events in a-frame (on mobile browser)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM