OSX: Capture 3-finger swipe events in NativeWindow
This commit is contained in:
parent
67db92d500
commit
03319a5426
7 changed files with 76 additions and 0 deletions
|
@ -267,6 +267,18 @@ bool ScopedDisableResize::disable_resize_ = false;
|
|||
|
||||
// NSWindow overrides.
|
||||
|
||||
- (void)swipeWithEvent:(NSEvent *)event {
|
||||
if (event.deltaY == 1.0) {
|
||||
shell_->NotifyWindowSwipeUp();
|
||||
} else if (event.deltaX == -1.0) {
|
||||
shell_->NotifyWindowSwipeRight();
|
||||
} else if (event.deltaY == -1.0) {
|
||||
shell_->NotifyWindowSwipeDown();
|
||||
} else if (event.deltaX == 1.0) {
|
||||
shell_->NotifyWindowSwipeLeft();
|
||||
}
|
||||
}
|
||||
|
||||
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen*)screen {
|
||||
// Resizing is disabled.
|
||||
if (ScopedDisableResize::IsResizeDisabled())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue