trackpad

Getting a custom UIView to respond to a two finger trackpad scroll gesture (or mouse scroll wheel)

非 Y 不嫁゛ 提交于 2020-08-04 23:14:09
问题 I have an iPad app (in C#) with a custom UIView that allows input via touch and Apple Pencil stylus touches. I am trying to integrate support for trackpad/mouse indirect (cursor, or "pointer" as Apple calls it). I got hover working using HoverGestureRecognizer. I got right-click and control-click working using normal touch Began/Moved/Ended/Cancelled events and checking for .type == .indirectPointer and then checking if the control key modifier in event.ModifierFlags is set, or if event

Prevent page navigation on horizontal scroll

。_饼干妹妹 提交于 2020-07-06 08:36:33
问题 I am using a mac trackpad.How to prevent the page going back and next to visited pages on horizontal scroll ?. I tried to prevent the wheel events but it doesn't works most of the time. container.addEventListener('wheel', function(ev) { ev.preventDefault(); ev.stopPropagation(); return false; }, {passive: false, capture: true}); even I tried blocking with mousewheel event which also leads to page navigation. 回答1: It has nothing to do with a webpage nor its events; this is specific system

Detecting absolute finger positions on trackpad

时光怂恿深爱的人放手 提交于 2020-01-05 05:39:06
问题 I'm on a 13" MacBook Pro (model 7,1. Mid-2010) and I recently installed Ubuntu 12.04 LTS. Essentially what I'm trying to do is make a program that invokes the right-click menu when a user clicks the bottom right corner of the Mac trackpad. The main issue here is detecting where exactly the user's position on the trackpad is . Of course, this is rather easy to do in OSX using NSTouch : - (void)touchesBeganWithEvent:(NSEvent *)event { NSSet *touches = [event touchesMatchingPhase

Is there a way to change rotation of gesture events?

佐手、 提交于 2019-12-24 11:16:32
问题 I need to trigger gesture events in Mac OS X. I found this question: Is there a way to trigger gesture events on Mac OS X? It works for me, but if I want to change rotation? For example, - (void)rotateWithEvent:(NSEvent *)event { NSLog(@"ROTATE: %f", [event rotation]); } -(IBAction)button:(id)sender { ... CGEventSourceRef eventSource = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState); CGEventRef event = CGEventCreate(eventSource); CGEventSetType(event, NSEventTypeRotate);

track-pad tap event in javascript/jquery

不打扰是莪最后的温柔 提交于 2019-12-22 11:22:57
问题 Is there any way to handle tap from track pad of mac? I need to handle 'tap' and 'click' on track-pad, especially on mac. I tried $.event.special.tap = { setup: function(data, namespaces) { var $elem = $(this); $elem.bind('touchstart', $.event.special.tap.handler) .bind('touchmove', $.event.special.tap.handler) .bind('touchend', $.event.special.tap.handler); }, teardown: function(namespaces) { var $elem = $(this); $elem.unbind('touchstart', $.event.special.tap.handler) .unbind('touchmove', $

How to detect the user is using the Trackpad and not the mouse in Java swing?

怎甘沉沦 提交于 2019-12-18 18:58:11
问题 I hava a Java swing application that use a 'pan-able' JComponent to display large data. When the user move the mouse wheel, I listen to these events, and update the content of the JComponent from the scrolled amount. I would like to have a different behavior depending on whether the user is using a classical mouse using a touchpad, as the ones that can be found on modern Mac laptops. How could I detect that the user is using the mouse wheel vs the trackpad to generate the scroll event? I am

Mac Cocoa: How to differentiate if a NSScrollWheel event is from a mouse or trackpad?

[亡魂溺海] 提交于 2019-12-18 16:49:30
问题 In my application, I want the scrolling to happen, only with scroll wheel action from a mouse and not from the two finger gesture on a trackpad. Basically, I am trying to determine if the scrollWheelEvent is generated from the mouse or trackpad, inside - (void)scrollWheel:(NSEvent *)theEvent method. From what I know so far, it seems like there is no straightforward way to accomplish this. I tried a work around of setting a boolean variable to true and false inside -(void)beginGestureWithEvent

know the position of the finger in the trackpad under Mac OS X

妖精的绣舞 提交于 2019-12-18 11:11:32
问题 I am developing an Mac application and I would like to know the position of the finger in the trackpad when there is a touch. Is it something possible and if yes, how? 回答1: Your view needs to be set to accept touches ( [self setAcceptsTouchEvents:YES] ). When you get a touch event like -touchesBeganWithEvent: , you can figure out where the finger lies by looking at its normalizedPosition (range is [0.0, 1.0] x [0.0, 1.0]) in light of its deviceSize in big points (there are 72 bp per inch).

jQuery Mousewheel doesn't support trackpad?

﹥>﹥吖頭↗ 提交于 2019-12-14 01:32:42
问题 I'm using the popular mousewheel plugin to to emulate the fullpage scroll like this website. jQuery(function() { var top = 0, viewport = jQuery(window).height(), step = jQuery(".home .l-section:first").outerHeight(), body = jQuery.browser.webkit ? jQuery('body') : jQuery('html'), wheel = false; jQuery('body').mousewheel(function(event, delta) { wheel = true; if (delta < 0) { top = (top + viewport) >= jQuery(document).height() ? top : top += step; body.stop().animate({ scrollTop: top }, 400,

Blackberry 6: how to detect a long click on track pad?

和自甴很熟 提交于 2019-12-11 04:05:45
问题 how do you detect a long click on a track pad please? I.e. on this thingy: I can detect a short click with: public boolean navigationClick(int status, int time) { // XXX return super.navigationClick(status, time); } And also I can detect a long click on a touch screen with: protected boolean touchEvent(TouchEvent event) { if (event.getEvent() == TouchEvent.GESTURE) { TouchGesture gesture = event.getGesture(); if (gesture.getEvent() == TouchGesture.HOVER) { // XXX return true; } } return super