touch-event

touchEvent while typing with soft keyboard android

别来无恙 提交于 2020-01-06 03:06:11
问题 in my application I would like to receive touchEvent(MotionEvent) event while the user is typing using his soft keyboard on a TextView. I have already tried using dispatchTouchEvent(MotionEvent) on the main activity, but during the typing this event is not fired. Is there a way to handle it? EDIT: The main idea is to have from the soft key two different events, one for the letter submitted (for example as with keyUp and keyDown) and one relative to the touch like dispatchTouchEvent, since

touchEvent while typing with soft keyboard android

落爺英雄遲暮 提交于 2020-01-06 03:05:56
问题 in my application I would like to receive touchEvent(MotionEvent) event while the user is typing using his soft keyboard on a TextView. I have already tried using dispatchTouchEvent(MotionEvent) on the main activity, but during the typing this event is not fired. Is there a way to handle it? EDIT: The main idea is to have from the soft key two different events, one for the letter submitted (for example as with keyUp and keyDown) and one relative to the touch like dispatchTouchEvent, since

Why mobile Safari touchEvents have negative timestamp?

喜你入骨 提交于 2020-01-05 09:06:24
问题 I use timestamps to accurately detect long press by comparing event timestamps with the requestAnimationFrame passed timestamp. By documentation both of these timestamps should be: This value is the number of milliseconds elapsed from the beginning of the current document's lifetime till the event was created. https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp I've created a jsFiddle, if I click with a mouse on a desktop, it shows positive numbers. If I open on an iPhone 7+, it

OpenGL-ES: How to set an object at the coordinates of the touch?

故事扮演 提交于 2020-01-05 09:04:38
问题 I'm looking for a way to have an opengl object(triangles etc) at the location on the screen where you touch the screen. I now have an 3D pyramid on the screen, wich moves over the screen, based on the difference between the start of your touch, and where you dragged it to. In normal surfaceViews I could just do something like element.x = event.getX() , but this will not work in openGL. So anyone has an idea? ps: i'm using java/Android. 回答1: OpenGL is nor like a surface view, where each

iOS - how to forward touches to the underlying uiview

≡放荡痞女 提交于 2020-01-05 07:40:50
问题 I have 3 UIViews of the same size stacked on top of each other. The topmost is transparent and only used for detecting touches. The type of touch detected will determine which of the other two underlying views I want to receive the touch events. Once the topmost view is finished with the touch, I need to forward the touch events to the correct underlying view. How can I do that? EDIT - I am adding my touch detection code. This is within MainViewController, whose view contains all 3 subviews.

OnLongPress is not working with our touch events

你说的曾经没有我的故事 提交于 2020-01-05 06:43:08
问题 I am developing a game in which I want to perform certain operations when user single touch the screen, and some other operations when user long press the screen. For this, I have created a Gesture Detector class and add events to them. Surface View Class public MySurfaceView(Context context, IAttributeSet attrs):base(context, attrs) { this.context=context; SetWillNotDraw(false); gestureDetector = new GestureDetector(context, new GestureListener()); } public override bool OnTouchEvent

OnLongPress is not working with our touch events

青春壹個敷衍的年華 提交于 2020-01-05 06:43:03
问题 I am developing a game in which I want to perform certain operations when user single touch the screen, and some other operations when user long press the screen. For this, I have created a Gesture Detector class and add events to them. Surface View Class public MySurfaceView(Context context, IAttributeSet attrs):base(context, attrs) { this.context=context; SetWillNotDraw(false); gestureDetector = new GestureDetector(context, new GestureListener()); } public override bool OnTouchEvent

fast swipe TouchEvent.ACTION_MOVE is missing Y coordinates and X coordinates

浪尽此生 提交于 2020-01-05 02:57:10
问题 My this question is somewhat related to my previous one that is here... I am getting X and Y values on TouchEvent.ACTION_MOVE . It works fine if I move my finger slowly but if I move my finger fast is misses out X and Y coordinates for which I have used History Events but still of no use.. I want continuous X and Y values without any jump Sample Code void printSamples(MotionEvent ev, RectangleParticleEmitter ps) { final int historySize = ev.getHistorySize(); final int pointerCount = ev

Bind multiple events to same function

强颜欢笑 提交于 2020-01-04 13:05:27
问题 How can I bind mutiple events to the same function. I want click and touchstart to do the same. And then I want a second function for mouseover. I would like to use this kind of setup: $(document).on({ click: function (event) { // I want this: click, touchstart: function (event) { event.preventDefault(); // do something }, mouseover: function (event) { event.preventDefault(); // do something } }, '.link'); 回答1: You can combine the events in one .on() with space: $(document).on('click

Stop touchend firing links unintentionally

妖精的绣舞 提交于 2020-01-02 18:23:33
问题 I'm using the touchend event to prevent ios from requiring two touches to fire href links. This works fine however it is firing the links unintentionally when scrolling. I know that the the solution is to implement the touchstart to see if there is movement, but I'm a jquery novice and I'm not sure how apply this. Here is the touchend code $('a').on('touchend', function(e) { var el = $(this); var link = el.attr('href'); window.location = link; }); Hope someone can help. Thanks 回答1: Ok this is