'Detect Cmd + klick on Catalyst with SwiftUI

I want to trigger differed events on tap, double tap and cmd+tap in a Mac- Catalyst application.

For the first two things I used the

.onTapGesture(count: 2) {
   print("double tap")
}
.onTapGesture(count: 1) {
   print("tapped")
}

and I know that on macOS there is an option to use this function:

.gesture(TapGesture().modifiers(.command).onEnded{ "cmd + tap" }).

But what is the best way to do this in a Catalyst app?

Thank you for your Ideas



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source