|
|
Created:
13 years ago by djeannot24 Modified:
12 years, 11 months ago CC:
rsc, codebot Visibility:
Public. |
DescriptionRemove swipe gestures.
Keep only 2-finger pinching and 3-finger tapping.
Patch Set 1 #Patch Set 2 : drop swipe gestures #MessagesTotal messages: 11
I am not sure about this particular set of gestures. I like the pinch for full screen and the 3-tap for middle click, given that 2-tap is already right click. However, the swipes really seem to come out of left field, and they are acme-specific. I am inclined to drop them all. The cut/copy/paste already have keystroke shortcuts anyway. A cleaner way to accommodate chording would be if you could, while holding one finger on the trackpad, put down a second finger to make a 1+3 chord, and then when you let go, you're back to just 1. Similarly putting down two extra fingers would give a 1+2 chord, and starting with three fingers and raising two would give a 2+1 chord. I don't know if that is possible, but it means I don't have to learn extra magic swipes: once I know how to do l, m, r clicks, I know how to combine them. Is that possible? Thanks.
Sign in to reply to this message.
I removed swipe gestures. Consequently, you can forget the 2 Acme patches regarding undo and argtext. (I pulled plan9port in between, so Codereview's "Delta from patch set" between 2 and 1 is meaningless: a problem I had not foreseen. We must use "Side-by-side diffs" instead.) I think your chording idea would be hard to implement. For example, if you put 3 fingers at the "same time", the trackpad could still register that your left finger touched the device first, and so, as you prepared yourself for a 2+1, you end up with a 1+2. Initially, I also thought using my trackpad like a mouse, but I came to the conclusion that a trackpad was not like a mouse. I think that chording was an excellent idea for mouse but that swiping is more natural for trackpad. I stopped using a mouse since the end of August, and I find the combination of Acme + trackpad delightful, and far more convenient than the combination of Acme + mouse (that I am using right now, because of my problem with Codereview). Of course, one must activates the "dragging with drag lock" option to make a trackpad useful. But I recognize that my swipe code is just a hack. I think the ideal would be to forward gesture events to p9p apps (with a gestures.h, initgestures(), etc.) and let them do whatever they want with these events. But I would be not at all shocked by Acme's using of swipes with trackpad, chords with mouse, and shortcuts with keyboard. They are just different kind of devices.
Sign in to reply to this message.
What kind of events does the trackpad send if you do a 3-tap and then take two fingers off? I am not worried about interpreting a 3-tap as a 1+2 tap because the trackpad already contains logic to tell those apart, right? I mean, 3-taps work right now without being misinterpreted. I wouldn't want to replace that recognition logic but I wonder if the trackpad is sending us event data that we could use directly. Thanks. Russ
Sign in to reply to this message.
Cocoa sends us the following high level events: swiping, pinching, and rotating. After a 2-tap, Cocoa sends us a mousedown event immediately followed by a mouseup event. After a 3-tap, cocoa sends us no high level event currently. So we use low level "touch" events to recognize 3-taps. Each touch event represents the status of 1 finger. Each time the status of 1 finger changes, we receive an event for each finger on the trackpad with its current status: down, up, moving or stationary. Here is the 3-tap implementation: switch eventstatus case fingerdown n = getnfinger if n is 3 start timer tapping = 1 if n > 3 tapping = 0 case fingermove tapping = 0 case fingerup n = getnfinger if n is 0 if tapping and timer<400msec sendclick 2 $PLAN9/src/cmd/devdraw/cocoa-screen.m:/^gettouch Here is the Apple documentation: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/EventO... Tell me if I misunderstand you.
Sign in to reply to this message.
LGTM
Sign in to reply to this message.
*** Submitted as a8c5d2dcba94 *** devdraw: enable gestures on OS X Remove swipe gestures. Keep only 2-finger pinching and 3-finger tapping. R=rsc CC=plan9port.codebot http://codereview.appspot.com/5498094 Committer: Russ Cox <rsc@swtch.com>
Sign in to reply to this message.
Another possibility for 2-1 is 3-fingers + physical click. Since physical clicks are the 1 button, this is pretty consistent: 3-finger tap is 2 button, then the click for the 1 (while the 3 fingers are still there). On 2012/01/18 15:30:32, rsc wrote: > What kind of events does the trackpad send > if you do a 3-tap and then take two fingers off? > > I am not worried about interpreting a 3-tap as > a 1+2 tap because the trackpad already contains > logic to tell those apart, right? I mean, 3-taps > work right now without being misinterpreted. > I wouldn't want to replace that recognition logic > but I wonder if the trackpad is sending us > event data that we could use directly. > > Thanks. > Russ
Sign in to reply to this message.
(I agree with David that gestures really are different from mouse buttons -- but it seems simpler to maintain reasonable analogies, unless we get 1st class gesture support in devdraw that can be passed along to the application)
Sign in to reply to this message.
> However, the swipes really seem to come out of left > field, and they are acme-specific. > A cleaner way to accommodate chording would be [...] My opinion is that chording also is Acme-specific (but maybe I am mistaken), and that Acme's chording is limited. Here an email I sent to Russ: I used Acme's chording for 4 years. During that time, I perceived those 3 limitations: 1) If you have previously selected some text, you can't easily cut it with the mouse. You must either reselect it, click on 'Cut' somewhere or use the keyboard. 2) If you have previously selected some text, you can't easily copy it with the mouse. You must either reselect it, click on 'Snarf' somewhere or use the keyboard. 3) If you have previously selected some text, you can't easily replace it with the mouse. You must either reselect it, click on 'Paste' somewhere or use the keyboard. With the swipe gestures, I do: 1) swipe-left anywhere in the Acme window 2) swipe-up anywhere in the Acme window 3) swipe-right anywhere in the Acme window And I see no more limitation. All the editing is done easily with the trackpad. What delighted me when I discovered Acme was that I could use it during 10 minutes before to realize that I was using the wrong keyboard layout: so much things could be done with just the mouse! I think It's even more true with the trackpad. I can even pilot Acme with my other hand now :) The problem with swiping is that, since OS X Lion, we don't receive swipe events anymore, unless we change the default configuration, because a swipe event means 3-finger, and Lion uses 3-finger by default for Mission Control, etc. I hope Apple will soon find a solution. A simple one would be: If the system uses 3-finger swipes, a swipe event means 4-finger. If the system uses 4-finger swipes, a swipe event means 3-finger.
Sign in to reply to this message.
|