Questions tagged [touch]

Touch-based interfaces have unique considerations that do not apply to other modes of input, and vice versa.

Touch-based interfaces are found on devices such as tablet PCs and touch-screen smartphones. The touch interfaces common today use capacitive technology designed to work well with simple finger touches. (Older, pressure-sensitive displays require the use of a stylus for accurate input.)

While touch input is similar to other two-dimensional input methods such as mice and drawing tablets, it lacks some characteristics of those other devices that are often taken for granted. For example, an on-screen cursor can be moved with a mouse to "hover" over an object without selecting it; there is no analogue to this in a touch interface because the act of pointing and selecting are both defined by a single touch.

Conversely, it is possible to do some kinds of input via touch that are difficult or impossible to represent with something like a mouse. In particular, modern "multitouch" interfaces allow two fingers to be used for pinching or stretching. Also, two or more fingers may be used to augment normal touching and dragging gestures (though this is analogous to using a mouse with alternate buttons or keyboard modifiers).

6318 questions
71
votes
1 answer

Variation of e.touches, e.targetTouches and e.changedTouches

Let's say I am listening for touchstart, touchmove and touchend on the body element. Let me know if I'm wrong, but I think e.touches is the same as e.targetTouches? If so, how e.changedTouches varies in relation with them? I mean, given one touch…
Andrei Zisu
  • 4,292
  • 4
  • 21
  • 32
71
votes
6 answers

Touch move getting stuck Ignored attempt to cancel a touchmove

I'm messing around with touch events on a touch slider and I keep getting the following error: Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted. I'm not…
souporserious
  • 2,079
  • 2
  • 27
  • 47
68
votes
9 answers

Detect touch press vs long press vs movement?

I'm currently fiddling around with Android programming, but I have a small problem detecting different touch events, namely a normal touch press (press on the screen and release right away), a long press (touch the screen and hold the finger on it)…
user504451
67
votes
11 answers

How to optimize website for touch devices

On a touch device like iPhone/iPad/Android it can be difficult to hit a small button with your finger. There is no cross-browser way to detect touch devices with CSS media queries that I know of. So I check if the browser has support for Javascript…
gregers
  • 12,523
  • 8
  • 46
  • 41
62
votes
5 answers

How can a service listen for touch gestures/events?

I'm wondering how apps like SwipePad and Wave Launcher are able to detect touch gestures/events simply through a service. These apps are able to detect a touch gestures even though it is not in their own Activity. I've looked all over the Internet…
Brian
  • 7,955
  • 16
  • 66
  • 107
62
votes
5 answers

Detecting Pan Gesture End

I've got a view and I applied a UIPanGestureRecogniser to this view: UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panAnim:)]; [sliderView addGestureRecognizer:panGesture]; [panGesture…
Dan Hanly
  • 7,829
  • 13
  • 73
  • 134
62
votes
7 answers

Simulate touch command with Java

I want to change modification timestamp of a binary file. What is the best way for doing this? Would opening and closing the file be a good option? (I require a solution where the modification of the timestamp will be changed on every platform and…
sinuhepop
  • 20,010
  • 17
  • 72
  • 107
61
votes
7 answers

Media query for devices supporting hover

I'd like to provide separate behaviour for browsers supporting hover (e.g. desktop browsers) and ones which don't (e.g. touchscreen devices). Specifically I want to declare a hover state on browsers that support it, but not for browsers that don't,…
moogal
  • 1,599
  • 2
  • 11
  • 12
61
votes
11 answers

How do I detect if an SKSpriteNode has been touched

I am trying to detect if my sprite node has been touched and I have no idea where to start. let Pineapple = SKSpriteNode(imageNamed: "Pineappleimg") Pineapple.userInteractionEnabled = true Pineapple.position = CGPoint(x: CGRectGetMidX(self.frame) -…
James Brennan
  • 635
  • 1
  • 6
  • 7
61
votes
4 answers

How to programmatically trigger the touch event in android?

I would like to trigger a touch event like this: First the finger is touch down at the (0,50%) of the screen and slide to the (50%,50%) of the screen, and exit (move the finger off the screen) I have found some thing like this: MotionEvent event =…
user782104
  • 13,233
  • 55
  • 172
  • 312
60
votes
12 answers

Tooltips in the era of touch

Tooltips are an incredibly useful interface paradigm to know an application. They are the mapping between the visual control and the application specific action associated to that control. The user can explore the action without invoking it just by…
Stefano Borini
  • 138,652
  • 96
  • 297
  • 431
58
votes
5 answers

Forwarding UIGesture to views behind

I am working on an iphone (iOS 4.0 or later) app and having some troubles with touch handling between multiple views. I am having a view structure like this ---> A superView | ---> SubView - A | ---> SubView - B (exactly on top…
Krishnabhadra
  • 34,169
  • 30
  • 118
  • 167
56
votes
1 answer

`pointermove` event not working with touch. Why not?

I have this pen: https://codepen.io/anon/pen/eyKeqK If you try it on a touch-screen device (f.e. visit the pen on your phone) you'll notice that when you drag, the white light (the little sphere) only moves for a tiny bit then it stops working. The…
trusktr
  • 44,284
  • 53
  • 191
  • 263
55
votes
6 answers

JavaScript touchend versus click dilemma

I am working on some javascript UI, and using a lot of touch events like 'touchend' for improved response on touch devices. However, there are some logical issues which are bugging me ... I have seen that many developers mingle 'touchend' and…
suncat100
  • 2,118
  • 1
  • 17
  • 22
51
votes
2 answers

touchend event properties

If I catch all touchend events from mobile devices with: $(document.body).bind('touchend', function (e) { var touch = e.touches[0]; // doesnt work ... I need to get the touch.screenX, touch.screenY, touch.clientX and touch.clientX from the e…
Matt Roberts
  • 26,371
  • 31
  • 103
  • 180