Skip to content

Commit

Permalink
Merge pull request #32 from p-x9/feature/property-for-show-above-keyb…
Browse files Browse the repository at this point in the history
…oard-window

Add property to indicate whether mark should be displayed above keyboard
  • Loading branch information
p-x9 authored Oct 16, 2023
2 parents 1ca480c + 98d9a9d commit 40b3ae5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Sources/TouchTracker/Cocoa/TouchTrackingUIView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,17 @@ public class TouchTrackingUIView: UIView {
public var displayMode: DisplayMode

/// A boolean value that indicates whether the event should propagate across windows.
/// If set to `true`, the touch events received in one window will also be shared
/// with other windows when applicable.
///
/// If set to `true`, touch events received in other windows will be propagated to this window as well.
public var shouldPropagateEventAcrossWindows: Bool = false

/// A boolean value that indicates whether display marks above keyboard window
///
/// If you want touched marks to appear above the keyboard, set this value to `true`
///
/// When displaying a view above the keyboard window, handling is required that is different from normal.
public var shouldDisplayAboveKeyboardWindow: Bool = false

var touches: Set<UITouch> = []
var locations: [CGPoint] = [] {
didSet {
Expand Down Expand Up @@ -201,7 +208,7 @@ public class TouchTrackingUIView: UIView {
window.center = .init(x: globalLocation.x + offset.x,
y: globalLocation.y + offset.y)

if shouldPropagateEventAcrossWindows,
if shouldDisplayAboveKeyboardWindow,
let screen = self.window?.screen,
let keyboardScene = UIWindowScene.keyboardScene(for: screen),
let keyboardRemoteWindow = keyboardScene.allWindows.first {
Expand Down

0 comments on commit 40b3ae5

Please sign in to comment.