trackpad

NSEvent and Magic Mouse

风格不统一 提交于 2019-12-10 11:40:07
问题 How do I distinguish whether the event -(void)scrollWheel:(NSEvent *)event was triggered by a Magic Mouse or a trackpad? The reason I'm asking this question is because I want to assign a different action to the scrolling event when a trackpad is used because the user can pinch to zoom on the trackpad. On the magic mouse, however, the user can't pinch easily, so I want to use the scrolling function as a substitute for pinching. I can distinguish between a normal mouse and a Magic Mouse using

NSEvent and Magic Mouse

a 夏天 提交于 2019-12-08 13:49:34
How do I distinguish whether the event -(void)scrollWheel:(NSEvent *)event was triggered by a Magic Mouse or a trackpad? The reason I'm asking this question is because I want to assign a different action to the scrolling event when a trackpad is used because the user can pinch to zoom on the trackpad. On the magic mouse, however, the user can't pinch easily, so I want to use the scrolling function as a substitute for pinching. I can distinguish between a normal mouse and a Magic Mouse using this line: if (([event momentumPhase] != NSEventPhaseNone) || [event phase] != NSEventPhaseNone) However

track-pad tap event in javascript/jquery

天大地大妈咪最大 提交于 2019-12-06 03:54:10
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', $.event.special.tap.handler) .unbind('touchend', $.event.special.tap.handler); }, handler: function(event

Generate and post Multitouch-Events in OS X to control the mac using an external camera

百般思念 提交于 2019-12-04 11:44:25
问题 I am currently working on a research project for my university. The goal is to control a Mac using the Microsoft Kinect camera. Another student is writing the Kinect driver (which will be mounted somewhere on the ceiling or the wall behind the Mac and which outputs the position of all fingers on the Macs screen). It is my responsibility to use that finger-positions and react on them. The goal is to use one single finger to control the mouse and react on multiple fingers the very same way,

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

最后都变了- 提交于 2019-11-30 17:26:55
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 relying in java 1.6 swing, si I cannot go to javaFX. Story behind the question: I just wanted to add a

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

点点圈 提交于 2019-11-30 13:49:25
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:(NSEvent *)event; and -(void)endGestureWithEvent:(NSEvent *)event; But this is not a solution because

Detect touchpad vs mouse in Javascript

陌路散爱 提交于 2019-11-28 20:33:36
Is there any way to detect if the client is using a touchpad vs. a mouse with Javascript? Or at least to get some reasonable estimate of the number of users that use touchpads as opposed to mice? In the general case, there is no way to do what you want. ActiveX might allow you to see and examine USB devices, but in the best case, even if that is somehow possible, that limits you to IE users. Beyond that, there is no way to know. You might be able to discern patterns in how (or how often) a touchpad user moves the cursor versus how a mouse user might move the cursor. Differentiating between

Check if user is scrolling with trackpad?

走远了吗. 提交于 2019-11-28 07:01:31
I have created a site where users are able to scroll through a gallery using mouse scroll or arrow up/down. It is working like I want it to, and changing one image pr scroll when scrolling with a mouse. But if the user is scrolling with a trackpad it is almost impossible to scroll a single image at a time. So my question is: Is there a way to check if the user is scrolling by trackpad, and then changing the behavior of the scrolling, so it becomes less sensitive, and thereby easier to scroll a single image at a time? I am not very good at jquery, my solution so far has been put together from a

Java trackpad 2-finger scroll listener

喜你入骨 提交于 2019-11-28 03:47:26
问题 how can i detect a 2-finger scroll on a laptop trackpad in java? I've been searching google and here but can't find anything on scrolling using a trackpad let alone how to listen for it. any help would be greatly appreciated. thanks. 回答1: If this is about listening for user scrolls, you can do it by adding a MouseWheelListener to your control. See How to Write a Mouse-Wheel Listener for more information. If this is about detecting specific events from the trackpad and not the mouse, I don't

JQuery - Can I query the MacBook Pro Trackpad?

做~自己de王妃 提交于 2019-11-27 18:45:16
问题 Can I use JQuery to query the Trackpad? So I can do something like this: Pseudo Javascript (JQuery) $(document).keyInput().trackpadTwoFingersLeft(function() { $('#div ul').animate({left: "=+1"},1); }); Is there a plugIn or another framework where I can do this? Thank you for every response and idea. :) 回答1: I've looked around a bit on the web, and so far see that both Chrome and Safari do not expose these events in the browser. https://superuser.com/questions/27627/three-finger-page-up-page