diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-14 12:53:48 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-14 12:54:49 +0300 |
| commit | 4c91e0213a3e7234c837ec54d6f17f28871fc586 (patch) | |
| tree | be1d747385e3b37d26ecd18b23d7c328689545db /tests/cocoa | |
| parent | 5ef6ca21ab9e1cf4f69254234d190a634b777d52 (diff) | |
cocoa: fix
Diffstat (limited to 'tests/cocoa')
| -rw-r--r-- | tests/cocoa/test_tablet.m | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/cocoa/test_tablet.m b/tests/cocoa/test_tablet.m index 5cd7375..c13ee07 100644 --- a/tests/cocoa/test_tablet.m +++ b/tests/cocoa/test_tablet.m @@ -22,6 +22,32 @@ @end @implementation TabletSample +{ + NSEventSubtype _subtype; + NSUInteger _buttonMask; +} +- (NSEventSubtype)subtype +{ + assert(self.type == NSEventTypeLeftMouseDown || self.type == NSEventTypeLeftMouseUp || + self.type == NSEventTypeRightMouseDown || self.type == NSEventTypeRightMouseUp || + self.type == NSEventTypeOtherMouseDown || self.type == NSEventTypeOtherMouseUp || + self.type == NSEventTypeMouseMoved || self.type == NSEventTypeLeftMouseDragged || + self.type == NSEventTypeRightMouseDragged || self.type == NSEventTypeOtherMouseDragged); + return _subtype; +} +- (void)setSubtype:(NSEventSubtype)subtype +{ + _subtype = subtype; +} +- (NSUInteger)buttonMask +{ + assert(self.type == NSEventTypeTabletPoint || self.subtype == NSEventSubtypeTabletPoint); + return _buttonMask; +} +- (void)setButtonMask:(NSUInteger)buttonMask +{ + _buttonMask = buttonMask; +} - (float)pressure { assert(self.type == NSEventTypeTabletPoint || self.subtype == NSEventSubtypeTabletPoint); @@ -160,6 +186,10 @@ int main(void) [view mouseMoved:native]; ev = next(surface, YASL_PRIVATE_EVENT_POINTER_MOTION); assert(ev.pointer.device == YASL_PRIVATE_PTR_DEV_MOUSE && !ev.pointer.pen.pressure); + sample.type = NSEventTypeMouseExited; + [view mouseExited:native]; + ev = next(surface, YASL_PRIVATE_EVENT_POINTER_LEAVE); + assert(ev.pointer.device == YASL_PRIVATE_PTR_DEV_MOUSE && ev.type == YASL_PRIVATE_EVENT_POINTER_LEAVE); [sample release]; yasl_private_surface_destroy(surface); yasl_private_display_close(display); |
