Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement pointersStream #64

Closed
appsforartists opened this issue Sep 15, 2016 · 7 comments
Closed

Implement pointersStream #64

appsforartists opened this issue Sep 15, 2016 · 7 comments
Assignees

Comments

@appsforartists
Copy link
Member

appsforartists commented Sep 15, 2016

On every pointer{down,move,up}, dispatch an array of all the current pointers.

@appsforartists appsforartists added this to the Direct Manipulation milestone Sep 15, 2016
@appsforartists
Copy link
Member Author

A naïve version of this would be

observableFrom(
  [
    'pointerenter',
    'pointerdown',
    'pointermove',
    'pointerup',
    'pointercancel',
    'pointerout',
    'pointerleave',
    'gotpointercapture',
    'lostpointercapture',
  ].map(
    type => observableFromEvent(target, type)
  )
)::mergeAll()::groupBy(
  event => event.pointerId
);

but that's not super helpful. We don't care about most of the non-core pointer events, but would want to handle down, move, and up independently.

@appsforartists appsforartists changed the title pointerEventMetastream Sep 15, 2016
@appsforartists
Copy link
Member Author

For the streams I need to implement, I don't think I need to even bother grouping by pointerId. If we can batch them into frames, we can map each frame into {position,rotation,scale} in the appropriate streams.

@appsforartists
Copy link
Member Author

Prototyping this in this pen

@appsforartists
Copy link
Member Author

appsforartists commented Sep 27, 2016

Should takeUntil(event.buttons & 1 == 0) to ensure that we only pay attention to events that include the primary button being depressed. That means is a particular pointer has the primary button down, then releases it without releasing all the buttons, then depresses it again, pointerStream will ignore it. Since this seems edge-casey, that should be fine for a first version.

We can always write a custom observable after the basics of direct manipulation are implemented and tested to handle this edge case.

@appsforartists
Copy link
Member Author

@appsforartists appsforartists changed the title Implement pointerEventMetastream Sep 28, 2016
@appsforartists appsforartists changed the title Implement pointerStream Sep 28, 2016
@appsforartists
Copy link
Member Author

💻 I'm working on a diff at http://codereview.cc/D1692

@jverkoey jverkoey removed this from the Direct Manipulation Gesture Streams milestone Dec 28, 2016
@jverkoey
Copy link

Deprecated by latest spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants