UIImageView Touch Event

you can use UITapGestureRecognizer added to the UIImageView via addGestureRecognizer snippets: UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(bannerTapped:)]; singleTap.numberOfTapsRequired = 1; singleTap.numberOfTouchesRequired = 1; [iv addGestureRecognizer:singleTap]; [iv setUserInteractionEnabled:YES]; and – (void)bannerTapped:(UIGestureRecognizer *)gestureRecognizer { NSLog(@”%@”, [gestureRecognizer view]); }

Show touch keyboard (TabTip.exe) in Windows 10 Anniversary edition

OK, I reverse engineered what explorer does when the user presses that button in the system tray. Basically it creates an instance of an undocumented interface ITipInvocation and calls its Toggle(HWND) method, passing desktop window as an argument. As the name suggests, the method either shows or hides the keyboard depending on its current state. … Read more

In unity3D, Click = Touch?

Short answer: yes, touch may be handled with Input.GetMouseButtonDown(). Input.GetMouseButtonDown(), Input.mousePosition, and associated functions work as tap on the touch screen (which is kind of odd, but welcome). If you don’t have a multi-touch game, this is a good way to keep the in-editor game functioning well while still keeping touch input for devices. (source: … Read more

Preferred Alternative to OnMouseOver for touch

Is there a preferred alternative or best practice for handling OnMouseOver javascript events on touch devices? The short answer is no. Device-specific events don’t have a 1:1 mapping to events from other devices. There is no proper equivalent of ‘hovering’ when using Touch. Mouse events (mouseover, mouseout, mousedown, mouseup, mousemove, etc) are specific to the … Read more

How to get touches when parent view has userInteractionEnabled set to NO in iOS

To get a view to let touches pass-through but give its subviews handle touches, let userInteractionEnabled on that view to YES and, instead, use this snippet: -(id)hitTest:(CGPoint)point withEvent:(UIEvent *)event { id hitView = [super hitTest:point withEvent:event]; if (hitView == self) return nil; else return hitView; } Source: http://cocoaheads.tumblr.com/post/2130871776/ignore-touches-to-uiview-subclass-but-not-to-its

Automatically pop up tablet touch keyboard on WinForms input focus

The root cause seems to be that Winforms’ textBox is not an AutomationElement, while the rest of the mentioned controls (ComboBoxes etc) are. Quoting Markus von und zu Heber’s accepted answer here: We found it in the article “Automatic Touch Keyboard for TextBoxes in WPF Applications on Windows 8+“, but it also works very good … Read more

Determine vertical direction of a touchmove

I had some issues in Ipad and solved it with two events var ts; $(document).bind(‘touchstart’, function (e){ ts = e.originalEvent.touches[0].clientY; }); $(document).bind(‘touchend’, function (e){ var te = e.originalEvent.changedTouches[0].clientY; if(ts > te+5){ slide_down(); }else if(ts < te-5){ slide_up(); } });

How to capture touchend coordinates?

You need to store the values on touchmove and read it in touchend. var lastMove = null; // Save the touchstart to always have a position div.addEvent(‘touchstart’, function(event) { lastMove = event; }); // Override with touchmove, which is triggered only on move div.addEvent(‘touchmove’, function(event) { lastMove = event; });