soderbjorn
08/02/2023, 5:06 PMModifier.transformable()
with a recent enough JDK (for example using code like this) but I have not been able to get it working. Has anyone else, or maybe knows if this is even supposed to work yet, or if there are any alternative ways of detecting trackpad pinch zoom?Nuru Nabiyev
08/02/2023, 7:43 PMNuru Nabiyev
08/02/2023, 9:09 PMGestureUtilities.addGestureListenerTo(window.rootPane, object : MagnificationListener,
GestureListener {
override fun magnify(e: MagnificationEvent?) {
println("magnify") // your stuff
}
})
But this will not compile because apparently oracle removed that since java 9. Check here and here.
Then you add those argument to your javac (check screenshot how to do it in intellij)
But that’s not enough because apparently there are some compilation errors. You just add @file:Suppress("JAVA_MODULE_DOES_NOT_EXPORT_PACKAGE")
It worked for me and now I am receiving events. I don’t know how it behaves on Window/Linux trackpadssoderbjorn
08/03/2023, 11:28 AMgetMagnification()
on MagnificationEvent
then?Nuru Nabiyev
08/03/2023, 12:44 PMIgor Demin
08/07/2023, 12:11 PMDear compose desktop team, please look into my solution in replies above. I was able to find the missing MacOS trackpad gestures, would be nice to incorporate those (along with Windows/Linux) to Modifier.transform . Let me know if something is neededThis solution can't be implemented in Compose itself, we can't use any private API to avoid backward compatibility issues. The only solution might be using native API.