-
Notifications
You must be signed in to change notification settings - Fork 96
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
[Infrared] Support tap emulate #262
base: dev
Are you sure you want to change the base?
Conversation
6ce5cab
to
22f615f
Compare
} else { | ||
guard let flipper = device.flipper else { return } | ||
|
||
if flipper.hasSingleEmulateSupport { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like it should be other way around
@@ -2,5 +2,7 @@ import Core | |||
import SwiftUI | |||
|
|||
extension EnvironmentValues { | |||
@Entry var emulateAction: (InfraredKeyID) -> Void = { _ in } | |||
@Entry var emulateAction: ( | |||
InfraredKeyID, Emulate.EmulateType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please separate arguments with a new line
onTap() | ||
} | ||
.gesture( | ||
LongPressGesture() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about that
@@ -24,6 +24,11 @@ public class Emulate: ObservableObject { | |||
case byIndex(Int) | |||
} | |||
|
|||
public enum EmulateType { | |||
case infinite |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
continuous fits better
case .infinite: | ||
try await application.buttonPress(index: index) | ||
case .single: | ||
try await application.buttonPressRelease(index: index) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still need waitForMinimumDuration
if we call press&release?
0443d5e
to
8700c80
Compare
No description provided.