Questions tagged [touch-event]

An event that is triggered when a user 'touches' a GUI component

A TouchEvent is an event that is triggered when a user 'touches' a GUI component. This is most commonly associated with applications that are designed to run on smart phones and touch screens. Many programming languages will treat an TouchEvent the same as a MouseEvent, which helps to provide touch functionality to applications that haven't specifically been designed for touch interactions.

1935 questions
15
votes
3 answers

In onTouchEvent, ACTION_UP doesn't work

I'd like to read when a player touches the screen, and when not. @Override public boolean onTouchEvent(MotionEvent event) { if(event.getAction() == MotionEvent.ACTION_UP){ //ACTION UP actionOnUP = true; Log.v("MC", "Up"); …
user1019901
  • 561
  • 3
  • 5
  • 11
14
votes
5 answers

drag and drop in android 3.x causes illegalStateException after small number on drags

there's a problem with drag and drop mechanism at android 3.x : after doing some drags (say 30 drags) an exception accrues (see the attached link) https://groups.google.com/forum/#!msg/android-platform/2APvO248NNY/rKI-5dCT8XcJ (I'm getting in log…
Tal Kanel
  • 10,475
  • 10
  • 60
  • 98
14
votes
2 answers

Prevent default Press but not default Drag in iOS MobileSafari?

Context: Web app on MobileSafari/iPad, both full-screen and embedded in iframe Goal: Technique that provides custom event handlers for Press and Tap but not Pinch (zoom) or Drag (scroll/pan). We want to provide custom behavior for Press, but to let…
James Baker
  • 5,978
  • 3
  • 25
  • 28
13
votes
7 answers

How to detect single touch as well as multi-touch in onTouchEvent()

I used the following code to detect the single finger touch and double finger touch. The code detects the double finger touch (when count==2). I need to do some action on single touch also. If I touch the screen with one finger it doesn't go for…
Manikandan
  • 1,479
  • 6
  • 48
  • 89
12
votes
6 answers

onTouchEvent onClick onLongClick calls

In our application, we handle the events in a button to record data. So initially when I use setOnLongClickListener() and setOnClickListener() together with the same button, it work fine for us. That means it will call both this listener base on the…
AndroidDev
  • 4,521
  • 24
  • 78
  • 126
12
votes
0 answers

React-native trigger/simulate touch on screen by given x, y coordinates

I would like to have a button in react-native app so that can trigger/simulate a touch on screen by given x, y coordinates. Just like: touchMe(x, y) Is there any ways that can help me to do that? I have read about some article about mock touch by…
Boomba
  • 121
  • 5
12
votes
0 answers

Windows 8 Touch Events Global Hook in C#, Stylus Pressure and Angle

There are some C# libraries that allow to capture mouse and keyboard events by listening to low level Windows calls by installing global hooks, but none of them allows capturing Windows 8 Stylus pressure. I would appreciate if someone could tell me…
user1577802
  • 196
  • 1
  • 8
12
votes
3 answers

Simulating touchstart and touchend events?

I'm developing a jquery component which works primarily for ipad. So is there anyway to simulate 'touchstart and 'touchend' events in desktop rather than having the device itself to check the events.
user1184100
  • 6,742
  • 29
  • 80
  • 121
11
votes
3 answers

Android OnGestureListener Fling is not detecting

I want to detect fling motion in a block of the screen. I am using the following code for that. public class MyinfoActivity extends Activity implements OnGestureListener { @Override public void onCreate(Bundle savedInstanceState) { …
dev_android
  • 8,698
  • 22
  • 91
  • 148
11
votes
1 answer

touchstart event does not trigger on scrollable div if already scrolling (on iPhone)

I have met this problem when scrolling on my iPhone 6 device (tested on Safari and Chrome): Given a scrollable div, if i touch the div when it's already on inertial scrolling motion, the scrolling motion stops as expected but the touchstart event…
Oscar Galo
  • 339
  • 2
  • 12
11
votes
2 answers

Javascript touch event: distinguishing finger vs. Apple Pencil

In Mobile Safari, is there any way to distinguish whether a touch event is generated by finger or Apple Pencil?
Ron
  • 7,588
  • 11
  • 38
  • 42
11
votes
1 answer

How do I get the coordinates of a map on tap with MapFragment (not MapView)?

I have searched around on how to get the coordinates of a location when the map is tapped. However, most, if not all the examples require a MapView as a parameter. For example: public boolean onTap(GeoPoint p, MapView map){ if ( isPinch ){ …
10
votes
1 answer

flutter hover-like touch handling - detect touch from different widgets without lifting the finger

Assume I have 3 Containers on the screen that react touching by changing their color. When user's finger is on them, they should change color and when touching ends they should turn back to normal. What I want is that those containers to react when…
buraky
  • 937
  • 1
  • 11
  • 18
10
votes
1 answer

Pass through touch events on React Native

We built a React Native tablet kiosk app which displays multiple pages of input fields to a user at a front desk. The user has to fill out all the forms and can send them at the end. Users can just walk away from the kiosk at any time, which would…
gtRfnkN
  • 489
  • 7
  • 19
10
votes
6 answers

Modernizr.touch returns true on firefox browser

I have written a peace of code to get the event based on touch and non-touch. Its working all other browsers and devices, but Firefox. Default FF return the true. var thumbsEvent, isTouch = Modernizr.touch; // detect the touch if(isTouch){ …
Sameera Thilakasiri
  • 9,452
  • 10
  • 51
  • 86