GitXplorerGitXplorer
i

PVPointerEvents

public
0 stars
0 forks
1 issues

Commits

List of commits on branch master.
Verified
c94c10b85d0ad723449b9cb90a3f5aa6683d5972

Create main.yml

iiskakaushik committed 4 years ago
Unverified
6d4f0e5da676bb4640afbca7ee436b418d65ae53

fix stuff

iiskakaushik committed 4 years ago
Verified
c8a7b2609d8bbd444f0a3f2b5a77535b3e0cfee7

Merge pull request #3 from iskakaushik/tmp

iiskakaushik committed 4 years ago
Unverified
9804db0651edb69aad22686815057c21a42408e9

gh actions

iiskakaushik committed 4 years ago
Unverified
b15525f2902cfe54d7e3684d3adc5576bc729816

test

iiskakaushik committed 4 years ago
Verified
2d8ef1f82181ee4dfbe779e39233037374c415f0

Merge pull request #2 from iskakaushik/circleci-project-setup

iiskakaushik committed 4 years ago

README

The README file for this repository.

PVPointerEvents

This is a proof-of-concept for handling pointer events when platform views are involved in the Flutter macOS embedding. We limit ourselves to handling mouseDown and mouseUp pointer events only, other events can be handled in a similar way. Click on each color/view to see what happens!

RootView (Black Color)

This view is the main view (in black color), that hosts the other sub views. This is equivalent to the main FlutterView on macOS, which will be a parent view for all the subviews. This is already wired to send all the pointer events to the framework on Flutter embedding for macOS.

We override the hitTest method to return this view as the hit target in the cases where the hit event corresponds to a PointerForwardingView view. Like so:

- (NSView *)hitTest:(NSPoint)aPoint {

  NSView* hitView = [super hitTest:aPoint];

  if ([hitView isKindOfClass:PointerForwardingView.class]) {

    return self;

  }

  return hitView;

}

PointerConsumingView (Blue Color)

This view consumes all the events as the hit test will rightly return this as the hit target.

PointerForwardingView (Green Color)

This view will never be the hit target as the parent view consumes the hit events. Once the framework receives events corresponding to this view, it will then use the gesture recognizers on the events and we can then forward the events to this view.